Skip to content

Commit d403f6b

Browse files
authored
Merge pull request #43 from assoconnect/fix/phpstan-rector
Fix PHPStan errors, add baseline for denormalize covariance
2 parents 5469f11 + 00b14c3 commit d403f6b

6 files changed

Lines changed: 48 additions & 39 deletions

File tree

composer.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
{
2-
"name": "assoconnect/php-date-bundle",
3-
"description": "Symfony bundle for assoconnect/php-date library",
4-
"type": "symfony-bundle",
5-
"license": "MIT",
6-
"autoload": {
7-
"psr-4": {
8-
"AssoConnect\\PHPDateBundle\\": "src/"
9-
}
10-
},
11-
"autoload-dev": {
12-
"psr-4": {
13-
"AssoConnect\\PHPDateBundle\\Tests\\": "tests/"
14-
}
15-
},
16-
"require-dev": {
17-
"symfony/contracts": "^2.4",
18-
"symfony/translation": "^7.0",
19-
"assoconnect/php-quality-config": "^2",
20-
"assoconnect/validator-bundle": "^2.19"
21-
},
22-
"require": {
23-
"ext-intl": "*",
24-
"php": "^8.3",
25-
"symfony/framework-bundle": "^7.0",
26-
"assoconnect/php-date": "^2.11",
27-
"doctrine/dbal": "^2.10|^3.0",
28-
"symfony/serializer": "^7.0",
29-
"twig/twig": "^3",
30-
"symfony/clock": "^7.3"
31-
},
32-
"config": {
33-
"allow-plugins": {
34-
"dealerdirect/phpcodesniffer-composer-installer": true
35-
}
36-
}
37-
}
1+
{
2+
"name": "assoconnect/php-date-bundle",
3+
"description": "Symfony bundle for assoconnect/php-date library",
4+
"type": "symfony-bundle",
5+
"license": "MIT",
6+
"autoload": {
7+
"psr-4": {
8+
"AssoConnect\\PHPDateBundle\\": "src/"
9+
}
10+
},
11+
"autoload-dev": {
12+
"psr-4": {
13+
"AssoConnect\\PHPDateBundle\\Tests\\": "tests/"
14+
}
15+
},
16+
"require-dev": {
17+
"symfony/contracts": "^2.4",
18+
"symfony/translation": "^7.0",
19+
"assoconnect/php-quality-config": "^2",
20+
"assoconnect/validator-bundle": "^2.39.2"
21+
},
22+
"require": {
23+
"ext-intl": "*",
24+
"php": "^8.3",
25+
"symfony/framework-bundle": "^7.0",
26+
"assoconnect/php-date": "^2.11",
27+
"doctrine/dbal": "^2.10|^3.0",
28+
"symfony/serializer": "^7.0",
29+
"twig/twig": "^3",
30+
"symfony/clock": "^7.3"
31+
},
32+
"config": {
33+
"allow-plugins": {
34+
"dealerdirect/phpcodesniffer-composer-installer": true
35+
}
36+
}
37+
}

phpstan-baseline.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Return type \(AssoConnect\\PHPDate\\AbsoluteDate\) of method AssoConnect\\PHPDateBundle\\Normalizer\\AbsoluteDateNormalizer\:\:denormalize\(\) should be covariant with return type \(\(\$type is class\-string\<object\> \? object \: mixed\)\) of method Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface\:\:denormalize\(\)$#'
5+
identifier: method.childReturnType
6+
count: 1
7+
path: src/Normalizer/AbsoluteDateNormalizer.php

phpstan.neon.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ parameters:
1010

1111
includes:
1212
- vendor/assoconnect/php-quality-config/phpstan.extension.neon
13+
- phpstan-baseline.neon

src/Twig/Extension/AbsoluteDateExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function __construct(TranslatorInterface $translator)
1919
$this->translator = $translator;
2020
}
2121

22+
/** @return list<TwigFilter> */
2223
public function getFilters(): array
2324
{
2425
return [

tests/Validator/ConstraintsSetFactory/Field/AbsoluteDateProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface
1818
return new AbsoluteDateProvider();
1919
}
2020

21-
public function getConstraintsForTypeProvider(): iterable
21+
public static function getConstraintsForTypeProvider(): iterable
2222
{
2323
yield [
2424
['type' => AbsoluteDateType::NAME],

tests/Validator/ConstraintsSetFactory/Field/DateTimeZoneProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface
1818
return new DateTimeZoneProvider();
1919
}
2020

21-
public function getConstraintsForTypeProvider(): iterable
21+
public static function getConstraintsForTypeProvider(): iterable
2222
{
2323
yield [
2424
['type' => DateTimeZoneType::NAME],

0 commit comments

Comments
 (0)