diff --git a/composer.json b/composer.json index 5c752f6..77de394 100644 --- a/composer.json +++ b/composer.json @@ -1,37 +1,37 @@ -{ - "name": "assoconnect/php-date-bundle", - "description": "Symfony bundle for assoconnect/php-date library", - "type": "symfony-bundle", - "license": "MIT", - "autoload": { - "psr-4": { - "AssoConnect\\PHPDateBundle\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "AssoConnect\\PHPDateBundle\\Tests\\": "tests/" - } - }, - "require-dev": { - "symfony/contracts": "^2.4", - "symfony/translation": "^7.0", - "assoconnect/php-quality-config": "^2", - "assoconnect/validator-bundle": "^2.19" - }, - "require": { - "ext-intl": "*", - "php": "^8.3", - "symfony/framework-bundle": "^7.0", - "assoconnect/php-date": "^2.11", - "doctrine/dbal": "^2.10|^3.0", - "symfony/serializer": "^7.0", - "twig/twig": "^3", - "symfony/clock": "^7.3" - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - } -} +{ + "name": "assoconnect/php-date-bundle", + "description": "Symfony bundle for assoconnect/php-date library", + "type": "symfony-bundle", + "license": "MIT", + "autoload": { + "psr-4": { + "AssoConnect\\PHPDateBundle\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "AssoConnect\\PHPDateBundle\\Tests\\": "tests/" + } + }, + "require-dev": { + "symfony/contracts": "^2.4", + "symfony/translation": "^7.0", + "assoconnect/php-quality-config": "^2", + "assoconnect/validator-bundle": "^2.39.2" + }, + "require": { + "ext-intl": "*", + "php": "^8.3", + "symfony/framework-bundle": "^7.0", + "assoconnect/php-date": "^2.11", + "doctrine/dbal": "^2.10|^3.0", + "symfony/serializer": "^7.0", + "twig/twig": "^3", + "symfony/clock": "^7.3" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +} diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..62aca99 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,7 @@ +parameters: + ignoreErrors: + - + message: '#^Return type \(AssoConnect\\PHPDate\\AbsoluteDate\) of method AssoConnect\\PHPDateBundle\\Normalizer\\AbsoluteDateNormalizer\:\:denormalize\(\) should be covariant with return type \(\(\$type is class\-string\ \? object \: mixed\)\) of method Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface\:\:denormalize\(\)$#' + identifier: method.childReturnType + count: 1 + path: src/Normalizer/AbsoluteDateNormalizer.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 1a1023f..0daa388 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -10,3 +10,4 @@ parameters: includes: - vendor/assoconnect/php-quality-config/phpstan.extension.neon + - phpstan-baseline.neon diff --git a/src/Twig/Extension/AbsoluteDateExtension.php b/src/Twig/Extension/AbsoluteDateExtension.php index fcd6120..c0c024e 100644 --- a/src/Twig/Extension/AbsoluteDateExtension.php +++ b/src/Twig/Extension/AbsoluteDateExtension.php @@ -19,6 +19,7 @@ public function __construct(TranslatorInterface $translator) $this->translator = $translator; } + /** @return list */ public function getFilters(): array { return [ diff --git a/tests/Validator/ConstraintsSetFactory/Field/AbsoluteDateProviderTest.php b/tests/Validator/ConstraintsSetFactory/Field/AbsoluteDateProviderTest.php index 6de8db2..fb5b706 100644 --- a/tests/Validator/ConstraintsSetFactory/Field/AbsoluteDateProviderTest.php +++ b/tests/Validator/ConstraintsSetFactory/Field/AbsoluteDateProviderTest.php @@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new AbsoluteDateProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => AbsoluteDateType::NAME], diff --git a/tests/Validator/ConstraintsSetFactory/Field/DateTimeZoneProviderTest.php b/tests/Validator/ConstraintsSetFactory/Field/DateTimeZoneProviderTest.php index 45f76d7..b271eb9 100644 --- a/tests/Validator/ConstraintsSetFactory/Field/DateTimeZoneProviderTest.php +++ b/tests/Validator/ConstraintsSetFactory/Field/DateTimeZoneProviderTest.php @@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new DateTimeZoneProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => DateTimeZoneType::NAME],