Skip to content

Commit c13b66c

Browse files
committed
Adjust project configuration & dependencies
1 parent 6bf93d1 commit c13b66c

15 files changed

Lines changed: 27 additions & 3156 deletions

.gitattributes

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
/tests export-ignore
22
/examples export-ignore
33
/docker export-ignore
4+
/vendor-bin export-ignore
5+
/.editorconfig export-ignore
46
/.gitattributes export-ignore
57
/.gitignore export-ignore
6-
/phpunit.xml.dist export-ignore
7-
/phpcs.xml.dist export-ignore
8-
/captainhook.json export-ignore
98
/.travis.yml export-ignore
10-
/ruleset.xml export-ignore
11-
/.editorconfig export-ignore
9+
/captainhook.json export-ignore
1210
/phpstan.neon export-ignore
13-
/phpstan_base.neon export-ignore
1411
/phpstan-baseline.neon export-ignore
12+
/phpunit.xml.dist export-ignore
1513
/psalm.xml export-ignore
1614
/psalm-baseline.xml export-ignore
17-
/vendor-bin export-ignore
15+
/ruleset.xml export-ignore

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
/composer.lock
33
/vendor
44
/vendor-bin/**/vendor
5-
/.phpunit*
5+
/vendor-bin/**/composer.lock
6+
/.phpunit.result.cache
7+
/.phpcs-cache
68
/tests/_output
79
/tests/_reports
810
/build

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ php:
1010

1111
before_script:
1212
- composer self-update
13-
- composer install --prefer-source --no-interaction --dev
13+
- composer install --prefer-source --no-interaction
14+
- composer bin all install
1415
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
1516
- chmod +x ./cc-test-reporter
1617
- ./cc-test-reporter before-build

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Squirrel Validator Cascade
22
==========================
33

4-
[![Build Status](https://img.shields.io/travis/com/squirrelphp/validator-cascade.svg)](https://travis-ci.com/squirrelphp/validator-cascade) [![Test Coverage](https://api.codeclimate.com/v1/badges/e056be025c6db0eb31f1/test_coverage)](https://codeclimate.com/github/squirrelphp/validator-cascade/test_coverage) ![PHPStan](https://img.shields.io/badge/style-level%207-success.svg?style=flat-round&label=phpstan) [![Packagist Version](https://img.shields.io/packagist/v/squirrelphp/validator-cascade.svg?style=flat-round)](https://packagist.org/packages/squirrelphp/validator-cascade) [![PHP Version](https://img.shields.io/packagist/php-v/squirrelphp/validator-cascade.svg)](https://packagist.org/packages/squirrelphp/validator-cascade) [![Software License](https://img.shields.io/badge/license-MIT-success.svg?style=flat-round)](LICENSE)
4+
[![Build Status](https://img.shields.io/travis/com/squirrelphp/validator-cascade.svg)](https://travis-ci.com/squirrelphp/validator-cascade) [![Test Coverage](https://api.codeclimate.com/v1/badges/e056be025c6db0eb31f1/test_coverage)](https://codeclimate.com/github/squirrelphp/validator-cascade/test_coverage) ![PHPStan](https://img.shields.io/badge/style-level%208-success.svg?style=flat-round&label=phpstan) [![Packagist Version](https://img.shields.io/packagist/v/squirrelphp/validator-cascade.svg?style=flat-round)](https://packagist.org/packages/squirrelphp/validator-cascade) [![PHP Version](https://img.shields.io/packagist/php-v/squirrelphp/validator-cascade.svg)](https://packagist.org/packages/squirrelphp/validator-cascade) [![Software License](https://img.shields.io/badge/license-MIT-success.svg?style=flat-round)](LICENSE)
55

66
Reimplements the `Valid` constraint in the Symfony validator component as `Cascade` annotation which is more straightforward to use than `Valid` and has no surprising behavior.
77

8-
This component is compatible with the Symfony validator component starting from version 4.0 and will be adapted to support future versions of Symfony if necessary.
8+
This component is compatible with the Symfony validator component in versions 4.0+ and 5.0+ and will be adapted to support future versions of Symfony (if any changes are necessary for that).
99

1010
Installation
1111
------------
1212

1313
composer require squirrelphp/validator-cascade
14-
14+
1515
Table of contents
1616
-----------------
1717

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"require-dev": {
2727
"bamarni/composer-bin-plugin": "^1.3",
28-
"captainhook/plugin-composer": "^4.0",
28+
"captainhook/plugin-composer": "^5.0",
2929
"mockery/mockery": "^1.0"
3030
},
3131
"config": {
@@ -43,17 +43,17 @@
4343
}
4444
},
4545
"scripts": {
46-
"post-install-cmd": ["@composer bin all install --ansi"],
47-
"post-update-cmd": ["@composer bin all update --ansi"],
4846
"phpstan": "vendor/bin/phpstan analyse",
49-
"phpstan_base": "vendor/bin/phpstan analyse --configuration phpstan_base.neon --error-format baselineNeon > phpstan-baseline.neon",
50-
"psalm": "vendor/bin/psalm --show-info=false",
47+
"phpstan_base": "vendor/bin/phpstan analyse --generate-baseline",
48+
"phpstan_clear": "vendor/bin/phpstan clear-result-cache",
49+
"psalm": "vendor/bin/psalm --show-info=false --diff",
50+
"psalm_full": "vendor/bin/psalm --show-info=false",
5151
"psalm_base": "vendor/bin/psalm --set-baseline=psalm-baseline.xml",
5252
"phpunit": "vendor/bin/phpunit --colors=always",
5353
"phpunit_clover": "vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml",
54-
"phpcs": "vendor/bin/phpcs --standard=ruleset.xml --extensions=php --cache src tests",
55-
"phpcsfix": "vendor/bin/phpcbf --standard=ruleset.xml --extensions=php --cache src tests",
5654
"codecoverage": "vendor/bin/phpunit --coverage-html tests/_reports",
55+
"phpcs": "vendor/bin/phpcs --standard=ruleset.xml --extensions=php --cache=.phpcs-cache --colors src tests",
56+
"phpcsfix": "vendor/bin/phpcbf --standard=ruleset.xml --extensions=php --cache=.phpcs-cache src tests",
5757
"binupdate": "@composer bin all update --ansi",
5858
"bininstall": "@composer bin all install --ansi"
5959
}

phpstan_base.neon

Lines changed: 0 additions & 6 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<phpunit
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.3/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.1/phpunit.xsd"
66
backupGlobals="false"
77
colors="true"
88
bootstrap="vendor/autoload.php"

psalm-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="3.7.2@d9cae720c1af31db9ba27c2bc1fcf9b0dd092fb0">
2+
<files psalm-version="3.11.2@d470903722cfcbc1cd04744c5491d3e6d13ec3d9">
33
<file src="examples/Address.php">
44
<MissingConstructor occurrences="1">
55
<code>$street</code>

ruleset.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?xml version="1.0"?>
22
<ruleset name="IQ">
3-
<description>PSR2 with some additional useful sniffs</description>
3+
<description>PSR12 with some additional useful sniffs</description>
44

5-
<!-- Include the whole PSR-2 standard except for line length -->
6-
<rule ref="PSR2">
5+
<!-- Include the whole PSR-12 standard except for line length -->
6+
<rule ref="PSR12">
77
<exclude name="Generic.Files.LineLength"/>
88
</rule>
99

10-
1110
<config name="installed_paths" value="../../slevomat/coding-standard"/>
1211

1312
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>

src/CascadeValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CascadeValidator extends ConstraintValidator
1111
public function validate($value, Constraint $constraint): void
1212
{
1313
if (!$constraint instanceof Cascade) {
14-
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Cascade');
14+
throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\Cascade');
1515
}
1616

1717
// Ignore null values, as there is nothing to cascade validation to

0 commit comments

Comments
 (0)