Skip to content

Commit 9f74838

Browse files
committed
Support Symfony 7
1 parent 323226e commit 9f74838

File tree

9 files changed

+35
-29
lines changed

9 files changed

+35
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Squirrel Validator Cascade
55

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

8-
This component is compatible with the Symfony validator component in version 5.x (v2.x with annotation/attribute support) and 6.x (v3.x with only attribute support) and will be adapted to support future versions of Symfony (if any changes are necessary for that).
8+
This component is compatible with the Symfony validator component in version 5.x (v2.x with annotation/attribute support) and 6.x/7.x (v3.x with only attribute support) and will be adapted to support future versions of Symfony (if any changes are necessary for that).
99

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

composer.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "squirrelphp/validator-cascade",
33
"type": "library",
4-
"description": "Cascade annotation for Symfony Validator annotation, reimplementing the Valid constraint in a more flexible and understandable way",
4+
"description": "Cascade attribute for Symfony Validator, reimplementing the Valid constraint in a more flexible and understandable way",
55
"keywords": [
66
"php",
77
"symfony",
@@ -20,16 +20,20 @@
2020
],
2121
"require": {
2222
"php": ">=8.0",
23-
"symfony/validator": "^6.0"
23+
"symfony/validator": "^6.0|^7.0"
2424
},
2525
"require-dev": {
2626
"bamarni/composer-bin-plugin": "^1.3",
2727
"captainhook/plugin-composer": "^5.0",
28-
"phpunit/phpunit": "^9.0",
28+
"phpunit/phpunit": "^10.0",
2929
"mockery/mockery": "^1.0"
3030
},
3131
"config": {
32-
"sort-packages": false
32+
"sort-packages": false,
33+
"allow-plugins": {
34+
"bamarni/composer-bin-plugin": true,
35+
"captainhook/plugin-composer": true
36+
}
3337
},
3438
"autoload": {
3539
"psr-4": {

phpunit.xml.dist

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
3-
<coverage>
4-
<include>
5-
<directory suffix=".php">src</directory>
6-
</include>
7-
</coverage>
8-
<testsuites>
9-
<testsuite name="Unit Tests">
10-
<directory>tests</directory>
11-
</testsuite>
12-
</testsuites>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
3+
<coverage includeUncoveredFiles="false"/>
4+
<testsuites>
5+
<testsuite name="Squirrel Test Suite">
6+
<directory>tests</directory>
7+
</testsuite>
8+
</testsuites>
9+
<source>
10+
<include>
11+
<directory>src</directory>
12+
</include>
13+
</source>
1314
</phpunit>

psalm-baseline.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="v4.15.0@a1b5e489e6fcebe40cb804793d964e99fc347820">
3-
<file src="src/Cascade.php">
4-
<PropertyNotSetInConstructor occurrences="1">
5-
<code>Cascade</code>
6-
</PropertyNotSetInConstructor>
7-
</file>
8-
</files>
2+
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591"/>

psalm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
xmlns="https://getpsalm.org/schema/config"
66
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
77
errorBaseline="psalm-baseline.xml"
8+
findUnusedBaselineEntry="true"
9+
findUnusedCode="false"
810
>
911
<projectFiles>
1012
<directory name="src" />

ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
5353
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
5454
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
55-
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing"/>
55+
<rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration"/>
5656
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
5757
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
5858
<rule ref="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants"/>

tests/OrderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ protected function setUp(): void
1717
parent::setUp();
1818

1919
$this->validator = \Symfony\Component\Validator\Validation::createValidatorBuilder()
20-
->enableAnnotationMapping()
20+
->enableAttributeMapping()
2121
->getValidator();
2222
}
2323

24-
public function testWithDifferentGroups()
24+
public function testWithDifferentGroups(): void
2525
{
2626
$order = new Order();
2727
$order->shippingAddress = new Address();
@@ -80,7 +80,7 @@ public function testWithDifferentGroups()
8080
}
8181
}
8282

83-
public function testWithNullValue()
83+
public function testWithNullValue(): void
8484
{
8585
$order = new Order();
8686
$order->shippingAddress = new Address();

vendor-bin/phpcs/composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"require": {
33
"squizlabs/php_codesniffer": "^3.5",
4-
"slevomat/coding-standard": "^7.0"
4+
"slevomat/coding-standard": "^8.0"
5+
},
6+
"config": {
7+
"allow-plugins": {
8+
"dealerdirect/phpcodesniffer-composer-installer": true
9+
}
510
}
611
}

vendor-bin/psalm/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"vimeo/psalm": "^4.0"
3+
"vimeo/psalm": "^5.0"
44
}
55
}

0 commit comments

Comments
 (0)