Skip to content

Commit

Permalink
Update packages and versions (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdekker authored Dec 7, 2023
1 parent c32e8db commit 1b77f76
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 39 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,12 @@
*.ttf -text diff
*.woff -text diff
*.woff2 -text diff

# Exclude directories/files from composer vendor package
/tests export-ignore
/.* export-ignore
/php*.json export-ignore
/php*.xml export-ignore
/php*.dist export-ignore
/php*.neon export-ignore
/renovate.json export-ignore
21 changes: 15 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ permissions:

jobs:
test:
name: PHP ${{ matrix.php-versions }} Test ${{ matrix.composer-flags }}
name: PHP ${{ matrix.php-versions }} - Symfony ${{ matrix.symfony }} - Test ${{ matrix.composer-flags }}
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
composer-flags: ['', '--prefer-lowest']
php-versions: [ '8.1', '8.2', '8.3' ]
symfony: [ '^6.2', '^7.0' ]
composer-flags: [ '', '--prefer-lowest' ]
exclude:
- php-versions: 8.1
symfony: '^7.0'
steps:
- uses: actions/checkout@v4

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

- name: Add symfony flex
run: composer global config --no-interaction allow-plugins.symfony/flex true && composer global require symfony/flex

- name: Validate composer.json and composer.lock
run: composer validate

Expand All @@ -44,7 +53,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3
coverage: pcov

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

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

quality:
name: Quality checks
Expand All @@ -65,7 +74,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
coverage: none

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

# Symfony Validation Shorthand
A validation shorthand component for Symfony, similar to the syntax in the "illuminate/validator" package for Laravel.
Expand Down
19 changes: 9 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@
}
},
"require": {
"php": ">=7.4",
"symfony/validator": "^5.0 || ^6.0",
"symfony/polyfill-php80": "^1.16"
"php": ">=8.1",
"symfony/validator": "^6.2||^7.0"
},
"require-dev": {
"digitalrevolution/phpunit-file-coverage-inspection": "^v1.0",
"digitalrevolution/phpunit-file-coverage-inspection": "^v2.0",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.6",
"phpmd/phpmd": "@stable",
"phpmd/phpmd": "^2.14",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpstan/extension-installer": "^1.1"
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-strict-rules": "^1.5",
"phpstan/extension-installer": "^1.3"
},
"scripts": {
"check": ["@check:phpstan", "@check:phpmd", "@check:phpcs"],
"check:phpstan": "phpstan analyse",
"check:phpmd": "phpmd src,tests text phpmd.xml.dist --suffixes=php",
"check:phpmd": "phpmd src,tests text phpmd.xml.dist --suffixes php",
"check:phpcs": "phpcs src tests",
"fix": "@fix:phpcbf",
"fix:phpcbf": "phpcbf src tests",
Expand Down
6 changes: 2 additions & 4 deletions src/Constraint/Type/BooleanValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ class BooleanValue extends Constraint
{
public const INVALID_BOOLEAN_ERROR = '83f4a7ef-a109-469e-941a-7fa757c73e22';

/** @var mixed */
protected static $errorNames = [
protected const ERROR_NAMES = [
self::INVALID_BOOLEAN_ERROR => 'INVALID_BOOLEAN_ERROR',
];

/** @var string */
public $message = '{{ value }} is not a valid boolean.';
public string $message = '{{ value }} is not a valid boolean.';
}
6 changes: 2 additions & 4 deletions src/Constraint/Type/FloatNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ class FloatNumber extends Constraint
public const INVALID_DECIMAL_ERROR = 'f7dfa2ce-5efa-40d4-a8ba-f02968039c28';
public const INVALID_VALUE_TYPE = '24e24f8a-fe44-4865-8cec-53c419ac0e87';

/** @var mixed */
protected static $errorNames = [
protected const ERROR_NAMES = [
self::INVALID_DECIMAL_ERROR => 'INVALID_DECIMAL_ERROR',
self::INVALID_VALUE_TYPE => 'INVALID_VALUE_TYPE',
];

/** @var string */
public $message = '{{ value }} is not a valid decimal.';
public string $message = '{{ value }} is not a valid decimal.';
}
8 changes: 3 additions & 5 deletions src/Constraint/Type/InConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ class InConstraint extends Constraint
{
public const NOT_IN_ERROR = '790265f3-05de-47d1-ae0a-1332f5299daf';

/** @var mixed */
protected static $errorNames = [
protected const ERROR_NAMES = [
self::NOT_IN_ERROR => 'NOT_IN_ERROR'
];

/** @var string */
public $message = '{{ value }} is not contained in `{{ values }}`.';
public string $message = '{{ value }} is not contained in `{{ values }}`.';

/** @var string[] */
public $values;
public array $values = [];

/**
* @inheritDoc
Expand Down
6 changes: 2 additions & 4 deletions src/Constraint/Type/IntegerNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ class IntegerNumber extends Constraint
public const INVALID_NUMBER_ERROR = 'fd2ba819-b3ad-4643-ae18-137817d63de9';
public const INVALID_VALUE_TYPE = 'af5ee700-4222-468a-8ff3-c3b394fc500b';

/** @var mixed */
protected static $errorNames = [
protected const ERROR_NAMES = [
self::INVALID_NUMBER_ERROR => 'INVALID_NUMBER_ERROR',
self::INVALID_VALUE_TYPE => 'INVALID_VALUE_TYPE',
];

/** @var string */
public $message = '{{ value }} is not a valid number.';
public string $message = '{{ value }} is not a valid number.';
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Symfony\Component\Validator\Validation;
use Symfony\Component\Validator\Validator\ValidatorInterface;

abstract class IntegrationTest extends TestCase
abstract class AbstractIntegrationTestCase extends TestCase
{
/** @var ConstraintFactory */
protected $constraintFactory;
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/DataArrayValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @coversNothing
*/
class DataArrayValidationTest extends IntegrationTest
class DataArrayValidationTest extends AbstractIntegrationTestCase
{
/**
* @throws Exception
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/TraversableArrayValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @coversNothing
*/
class TraversableArrayValidationTest extends IntegrationTest
class TraversableArrayValidationTest extends AbstractIntegrationTestCase
{
/**
* @throws Exception
Expand Down

0 comments on commit 1b77f76

Please sign in to comment.