Skip to content

Commit 1b77f76

Browse files
authored
Update packages and versions (#51)
1 parent c32e8db commit 1b77f76

File tree

11 files changed

+48
-39
lines changed

11 files changed

+48
-39
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,12 @@
5353
*.ttf -text diff
5454
*.woff -text diff
5555
*.woff2 -text diff
56+
57+
# Exclude directories/files from composer vendor package
58+
/tests export-ignore
59+
/.* export-ignore
60+
/php*.json export-ignore
61+
/php*.xml export-ignore
62+
/php*.dist export-ignore
63+
/php*.neon export-ignore
64+
/renovate.json export-ignore

.github/workflows/test.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ permissions:
1111

1212
jobs:
1313
test:
14-
name: PHP ${{ matrix.php-versions }} Test ${{ matrix.composer-flags }}
14+
name: PHP ${{ matrix.php-versions }} - Symfony ${{ matrix.symfony }} - Test ${{ matrix.composer-flags }}
15+
env:
16+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
1517
runs-on: ubuntu-latest
1618
strategy:
1719
matrix:
18-
php-versions: ['7.4', '8.0', '8.1']
19-
composer-flags: ['', '--prefer-lowest']
20+
php-versions: [ '8.1', '8.2', '8.3' ]
21+
symfony: [ '^6.2', '^7.0' ]
22+
composer-flags: [ '', '--prefer-lowest' ]
23+
exclude:
24+
- php-versions: 8.1
25+
symfony: '^7.0'
2026
steps:
2127
- uses: actions/checkout@v4
2228

@@ -26,6 +32,9 @@ jobs:
2632
php-version: ${{ matrix.php-versions }}
2733
coverage: none
2834

35+
- name: Add symfony flex
36+
run: composer global config --no-interaction allow-plugins.symfony/flex true && composer global require symfony/flex
37+
2938
- name: Validate composer.json and composer.lock
3039
run: composer validate
3140

@@ -44,7 +53,7 @@ jobs:
4453
- name: Setup PHP
4554
uses: shivammathur/setup-php@v2
4655
with:
47-
php-version: 8.1
56+
php-version: 8.3
4857
coverage: pcov
4958

5059
- name: Install dependencies
@@ -54,7 +63,7 @@ jobs:
5463
run: php -dpcov.enabled=1 -dpcov.exclude="~vendor~" vendor/bin/phpunit --testsuite unit --coverage-clover ./.coverage/coverage.xml
5564

5665
- name: Check coverage
57-
run: php vendor/bin/phpfci inspect ./.coverage/coverage.xml ./.coverage/phpfci.xml --exit-code-on-failure
66+
run: test ! -f ./.coverage/coverage.xml || php vendor/bin/phpfci inspect ./.coverage/coverage.xml --exit-code-on-failure --reportText
5867

5968
quality:
6069
name: Quality checks
@@ -65,7 +74,7 @@ jobs:
6574
- name: Setup PHP
6675
uses: shivammathur/setup-php@v2
6776
with:
68-
php-version: 7.4
77+
php-version: 8.1
6978
coverage: none
7079

7180
- name: Install dependencies

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF)](https://php.net/)
2-
[![Minimum Symfony Version](https://img.shields.io/badge/symfony-%3E%3D%205.0-brightgreen)](https://symfony.com/doc/current/validation.html)
3-
![Run tests](https://github.com/123inkt/symfony-validation-shorthand/workflows/Run%20tests/badge.svg)
1+
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF)](https://php.net/)
2+
[![Minimum Symfony Version](https://img.shields.io/badge/symfony-%3E%3D%206.2-brightgreen)](https://symfony.com/doc/current/validation.html)
3+
![Run tests](https://github.com/123inkt/symfony-validation-shorthand/actions/workflows/test.yml/badge.svg)
44

55
# Symfony Validation Shorthand
66
A validation shorthand component for Symfony, similar to the syntax in the "illuminate/validator" package for Laravel.

composer.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,24 @@
2121
}
2222
},
2323
"require": {
24-
"php": ">=7.4",
25-
"symfony/validator": "^5.0 || ^6.0",
26-
"symfony/polyfill-php80": "^1.16"
24+
"php": ">=8.1",
25+
"symfony/validator": "^6.2||^7.0"
2726
},
2827
"require-dev": {
29-
"digitalrevolution/phpunit-file-coverage-inspection": "^v1.0",
28+
"digitalrevolution/phpunit-file-coverage-inspection": "^v2.0",
3029
"roave/security-advisories": "dev-latest",
3130
"squizlabs/php_codesniffer": "^3.6",
32-
"phpmd/phpmd": "@stable",
31+
"phpmd/phpmd": "^2.14",
3332
"phpunit/phpunit": "^9.5",
34-
"phpstan/phpstan": "^1.4",
35-
"phpstan/phpstan-phpunit": "^1.0",
36-
"phpstan/phpstan-strict-rules": "^1.1",
37-
"phpstan/extension-installer": "^1.1"
33+
"phpstan/phpstan": "^1.10",
34+
"phpstan/phpstan-phpunit": "^1.3",
35+
"phpstan/phpstan-strict-rules": "^1.5",
36+
"phpstan/extension-installer": "^1.3"
3837
},
3938
"scripts": {
4039
"check": ["@check:phpstan", "@check:phpmd", "@check:phpcs"],
4140
"check:phpstan": "phpstan analyse",
42-
"check:phpmd": "phpmd src,tests text phpmd.xml.dist --suffixes=php",
41+
"check:phpmd": "phpmd src,tests text phpmd.xml.dist --suffixes php",
4342
"check:phpcs": "phpcs src tests",
4443
"fix": "@fix:phpcbf",
4544
"fix:phpcbf": "phpcbf src tests",

src/Constraint/Type/BooleanValue.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ class BooleanValue extends Constraint
99
{
1010
public const INVALID_BOOLEAN_ERROR = '83f4a7ef-a109-469e-941a-7fa757c73e22';
1111

12-
/** @var mixed */
13-
protected static $errorNames = [
12+
protected const ERROR_NAMES = [
1413
self::INVALID_BOOLEAN_ERROR => 'INVALID_BOOLEAN_ERROR',
1514
];
1615

17-
/** @var string */
18-
public $message = '{{ value }} is not a valid boolean.';
16+
public string $message = '{{ value }} is not a valid boolean.';
1917
}

src/Constraint/Type/FloatNumber.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ class FloatNumber extends Constraint
1010
public const INVALID_DECIMAL_ERROR = 'f7dfa2ce-5efa-40d4-a8ba-f02968039c28';
1111
public const INVALID_VALUE_TYPE = '24e24f8a-fe44-4865-8cec-53c419ac0e87';
1212

13-
/** @var mixed */
14-
protected static $errorNames = [
13+
protected const ERROR_NAMES = [
1514
self::INVALID_DECIMAL_ERROR => 'INVALID_DECIMAL_ERROR',
1615
self::INVALID_VALUE_TYPE => 'INVALID_VALUE_TYPE',
1716
];
1817

19-
/** @var string */
20-
public $message = '{{ value }} is not a valid decimal.';
18+
public string $message = '{{ value }} is not a valid decimal.';
2119
}

src/Constraint/Type/InConstraint.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ class InConstraint extends Constraint
99
{
1010
public const NOT_IN_ERROR = '790265f3-05de-47d1-ae0a-1332f5299daf';
1111

12-
/** @var mixed */
13-
protected static $errorNames = [
12+
protected const ERROR_NAMES = [
1413
self::NOT_IN_ERROR => 'NOT_IN_ERROR'
1514
];
1615

17-
/** @var string */
18-
public $message = '{{ value }} is not contained in `{{ values }}`.';
16+
public string $message = '{{ value }} is not contained in `{{ values }}`.';
1917

2018
/** @var string[] */
21-
public $values;
19+
public array $values = [];
2220

2321
/**
2422
* @inheritDoc

src/Constraint/Type/IntegerNumber.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ class IntegerNumber extends Constraint
1010
public const INVALID_NUMBER_ERROR = 'fd2ba819-b3ad-4643-ae18-137817d63de9';
1111
public const INVALID_VALUE_TYPE = 'af5ee700-4222-468a-8ff3-c3b394fc500b';
1212

13-
/** @var mixed */
14-
protected static $errorNames = [
13+
protected const ERROR_NAMES = [
1514
self::INVALID_NUMBER_ERROR => 'INVALID_NUMBER_ERROR',
1615
self::INVALID_VALUE_TYPE => 'INVALID_VALUE_TYPE',
1716
];
1817

19-
/** @var string */
20-
public $message = '{{ value }} is not a valid number.';
18+
public string $message = '{{ value }} is not a valid number.';
2119
}

tests/Integration/IntegrationTest.php renamed to tests/Integration/AbstractIntegrationTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Symfony\Component\Validator\Validation;
1111
use Symfony\Component\Validator\Validator\ValidatorInterface;
1212

13-
abstract class IntegrationTest extends TestCase
13+
abstract class AbstractIntegrationTestCase extends TestCase
1414
{
1515
/** @var ConstraintFactory */
1616
protected $constraintFactory;

tests/Integration/DataArrayValidationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* @coversNothing
1111
*/
12-
class DataArrayValidationTest extends IntegrationTest
12+
class DataArrayValidationTest extends AbstractIntegrationTestCase
1313
{
1414
/**
1515
* @throws Exception

0 commit comments

Comments
 (0)