Commit graph

78 commits

Author SHA1 Message Date
Henrique Moody 16376306f8
Use "Respect" coding standard
There are too many PHP_CodeSniffer configurations in this repository.

I have created "respect/coding-standard" to deal with all the
configuration so in this repository we only need to add "Respect" as our
PHP_CodeSniffer rule.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-11 20:51:39 +02:00
Henrique Moody 272f18dcf5
Apply "Symfony.Functions.ScopeOrder"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-11 20:00:19 +02:00
Henrique Moody 95b499b627
Apply "phpstan/phpstan-deprecation-rules" rules
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-05 15:18:09 +02:00
Henrique Moody 1303a935bf
Convert case of "mikey179/vfsstream" package
Package names in Composer should not contain uppercase characters, and
after the version 2.0, it will error.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-04-23 20:13:12 +02:00
Henrique Moody 166501804f
Refactor "Zend" rule
- Only create objects that are instantiable.

- Validate if validator is a valid Zend Validator after its creation.

- Parse messages from Zend Validator on "assert()" and "check()."

- Upgrade supported version of Zend Validator: version 2.0 has some PHP
  deprecations therefore there is no used to support it.

Co-authored-by: Danilo Correa <danilosilva87@gmail.com>
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-03-10 22:13:16 +01:00
Henrique Moody 0c4a278709
Add some code sniffs that we already use
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-09 14:07:47 +01:00
Henrique Moody f52097075b
Increase PHPStan level to 2
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-04 00:29:13 +01:00
Henrique Moody b7043b2652
Set up "squizlabs/php_codesniffer"
The tool we used to verify whether the code base has the correct coding
standard was removed [1].

This commit will set up one that works best for us and will also make
sure we have fully compliant to PS1 and PSR2.

[1]: ffec95acda

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-03 19:39:14 +01:00
Henrique Moody 2b86e5443e
Update paths of Composer scripts
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-03 19:01:12 +01:00
Henrique Moody ffec95acda
Remove PHP-CS-Fixer
It is not the first time that after a PHP-CS-Fixer upgrade our build
fails. Also, I've seemed a couple of files that have a wrong coding
standard, but PHP-CS-Fixer does not indicate failure for them.

This commit will remove the library as a dependency.

I plan to introduce PHP_CodeSniffer as soon as possible.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-03 16:26:23 +01:00
Danilo Correa b399bfe1c1
Create Composer scripts to help during development
This commit will create Composer scripts for commands that are
frequently used during the development of the library.

Co-authored-by: Henrique Moody <henriquemoody@gmail.com>
2018-10-03 00:04:10 +02:00
Henrique Moody c7fcc09af6
Upgrade PHPUnit version
The changes you see in this commit had to be made due to the upgrade of
PHPunit version.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-09-03 17:37:44 +02:00
Henrique Moody 258a456eec
Setup PHPStan (PHP Static Analysis Tool)
Require "phpstan/phpstan" for development and add to the Travis CI
configuration file to execute the analysis when Travis executes the
build with the version 7.2 of PHP.

The level of the configuration is very week for now (just "1") and still
quite some changes had to be made in order to make the analysis pass. I
hope it does not take much time to increase the level of the strictness
of the analyses.

I tried to configure that before but because of dependencies with
"symfony/validator" it was not possible.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-08-22 19:10:20 +02:00
Henrique Moody 1da164a26e
Change how "Sf" rule works
Instead of creating the Symfony constraints itself "Sf" accepts an
instance of "Symfony\Component\Validator\Constraint".

Creating objects inside a rule, specially from an external library,
makes the rule too complex and also limits the possibilities with the
"Sf" rule since Symfony allows users to create complex validations (even
thought their API is not as simple as ours).

This commit also simplifies the way the messages are passed from Symfony
to the "Sf" when only one constraint has failed; instead of passing
the message of the whole constraint violation list, only the fist
constraint violation message it passed.

The problem that this rule will always have is that when using "Not" to
invert the validation we have a way to get a proper message since
Symfony Validator only return the result of constraints that failed.
That's something the Respect\Validation does in a similar way and to
change it a lot has to be changed.

These changes were checked in "symfony/validator" 4.0 and the version
was added to the "composer.json" file.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-08-22 17:46:21 +02:00
Burhan Ali f03a09aa24 Replace fabpot/php-cs-fixer with friendsofphp/php-cs-fixer
The fapbot version is abandoned accord to packagist and suggests the
friendsofphp version.
2018-03-08 13:11:30 +00:00
Henrique Moody a796d9e981
Update license to MIT 2018-03-03 19:06:38 +01:00
Henrique Moody fe3654b270
Improve RuleTestCase class
- Add documentation to the class and its methods;
- Move RuleTestCase to Test namespace;
- Use PHP 7 type hinting;
- Rename getRuleMock() to createValidatableMock().
2018-01-07 14:32:05 +01:00
Henrique Moody 2d7e2ea48f
Add "respect/stringifier" as dependency
Due to this change it was possible to identify that NotEmptyException,
and NotOptionalException where not working as they should. A fix was
made along with this commit.
2018-01-06 14:07:03 +01:00
Henrique Moody ef975629f3
Changes on PHP-CS-Fixer configuration
Because of `declare(strict_types=1)` some changes were necessary.
2018-01-04 17:59:37 +01:00
Henrique Moody 0bb9b14658
Drop support for PHP 7.0 2018-01-03 11:09:02 +01:00
Gabriel Caruso 93ce9cb93a
Updated to PHPUnit 6 2017-11-12 14:22:22 +01:00
Henrique Moody d8e5f305a7
Remove "malkusch/bav" as a dependency
This packages is not maintained anymore, therefore it should be removed
from our codebase.
2017-11-12 13:59:05 +01:00
Henrique Moody 2f7a479b58
Add "ext-fileinfo" as suggestion 2017-04-11 11:27:21 +02:00
Henrique Moody 07a120d058
Upgrade "symfony/validator" version 2016-11-05 14:14:39 +01:00
Henrique Moody 867f12b8d3
Update version constraints on composer.json file 2016-11-05 14:14:38 +01:00
Henrique Moody 0512ff4866
Drop support for HHVM and PHP 5.6
Also make some improvements on .travis.yml file.
2016-11-05 13:20:07 +01:00
Henrique Moody f2bb77bb8e
Create tests for "egulias/email-validator" ~2.1 2016-10-29 15:37:09 +02:00
Jefersson Nathan e1678be8f2 Add license check by file to build
* composer require --dev malukenho/docheader
* Add license layout
* Add check license to the build
2016-10-29 12:31:13 +02:00
Henrique Moody d2efb6923f
Merge branch '1.1' 2016-09-17 23:00:41 +02:00
Henrique Moody d30b3d1b49
Merge branch '1.0' into 1.1 2016-09-17 22:59:31 +02:00
Henrique Moody 8b32270d28
Add "symfony/polyfill-mbstring" as a dependency 2016-09-17 22:30:35 +02:00
Henrique Moody 8b7f48c3b7 Upgrade PHPUnit version 2016-05-25 23:25:28 +02:00
Henrique Moody bc190e0eb0 Drop support for PHP <5.6 2016-05-06 11:12:56 +02:00
Henrique Moody f13ee908e0 Upgrade of the work in progress version
- May the Force be with us.
2016-04-24 21:21:12 -03:00
Woody Gilk c951cef919 Fix homepage URL in composer config 2016-01-13 15:43:06 -06:00
Henrique Moody 67642dad9c Update working in progress version 2015-10-24 01:45:10 -02:00
Rogerio Prado de Jesus e44b93f055 Create "composer test" command in order to run phpunit tests
As the project already is installed via composer, this command
could save a few keystrokes!

Besides that, is just one command for all OS, because will not be
needed to change slashes to backslashes in Windows.

*X      (21 keystrokes): `./vendor/bin/phpunit`
Windows (21 keystrokes): `.\vendor\bin\phpunit`
New (14 keystrokes):     `composer test`

https://getcomposer.org/doc/articles/scripts.md#writing-custom-commands
2015-10-19 10:12:55 -02:00
Henrique Moody 4964d561c4 Rename namespace of *TestCase classes 2015-10-18 14:50:59 -02:00
Henrique Moody 06ecd9c063 Drop support for PHP 5.3 2015-10-17 12:55:52 -03:00
Marcel Voigt 4329252709 Suggest php-cs-fixer and add default config
See .php_cs for default configuration. Install php-cs-fixer globally and run
  php-cs-fixer fix
to fix common coding standards or style issues.
2015-08-10 20:22:04 +02:00
Henrique Moody 29fd82815b Update work in progress version in Composer's file 2015-07-21 12:35:29 -03:00
Henrique Moody 96f4fc2e6f Create "Extension" rule
Updates required PHP version to 5.3.6 since SplFileInfo::getExtension()
was created on this version.
2015-06-18 23:07:50 -03:00
Henrique Moody cc6da3a2e4 Create "Size" rule 2015-06-18 23:07:22 -03:00
Henrique Moody 124ac05e02 Merge branch '0.9' 2015-06-06 10:09:05 -03:00
Henrique Moody 403b80e92c Merge branch '0.8' into 0.9 2015-06-06 10:06:25 -03:00
Henrique Moody 7223973112 Pin "symfony/validator" version on 2.6.x 2015-06-06 09:55:19 -03:00
Henrique Moody 9c5591f9b8 Update work in progress version in Composer's file 2015-04-24 20:07:06 -03:00
Eduardo Gulias Davis 13c3c92ae6 Use "egulias/emailvalidator" for email validation 2015-03-01 21:10:30 -03:00
Henrique Moody 0d6b505df4 Update work in progress version in Composer's file 2015-02-11 13:07:45 -02:00
Henrique Moody d0f07ecc5f Mock malkusch\bav\BAV on tests 2015-02-03 13:52:22 -02:00