Commit graph

69 commits

Author SHA1 Message Date
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
Henrique Moody b0816ab36f Remove unnecessary checkings on unit tests
Since we are using only composer as autoloader and we have all
dependencies on `require-dev` there is no need to check if third-party
libraries are present or not
2015-01-17 17:04:05 -02:00
Markus Malkusch 623a26235e Added bank(), bankAccount() and bic(). Currently only German. 2015-01-14 21:17:04 +01:00
Henrique Moody e5ef9fe309 Update working in progress version in composer.json 2015-01-08 00:52:41 -02:00
Henrique Moody ea7b787953 Update "composer.json" file
Remove unecessary directives and updated dependencies versions.
2015-01-07 16:02:58 -02:00
Jefersson Nathan cc80628c4d Add minimum php required version to composer.json 2014-10-01 08:37:48 -03:00
Augusto Pascutti b5cc9c7dd6 Merge pull request #194 from GrahamCampbell/alias
Branch alias added on composer.

Alias the `master` branch to the next milestone (tag).
2014-07-12 20:09:08 -03:00
Graham Campbell ae056920b4 PSR-4 autoloading 2014-07-12 20:20:43 +01:00
Graham Campbell 5d902267f5 Added branch alias 2014-07-12 20:19:17 +01:00
Graham Campbell c4df7e55b9 Update composer.json 2014-04-21 19:57:25 +01:00