Skip to content

Commit

Permalink
Bump Psalm version from 4.7 to 4.22
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Apr 15, 2022
1 parent 7c8aed1 commit a1382f0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:
(cd src/Bundle/test && bin/console doctrine:database:create)
(cd src/Bundle/test && bin/console doctrine:schema:create)
-
name: Run Psalm
run: vendor/bin/psalm --php-version=${{ matrix.php }}

-
name: Run analysis
run: |
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"symfony/workflow": "^4.4 || ^5.4 || ^6.0",
"symplify/easy-coding-standard": "^9.4",
"twig/twig": "^2.12 || ^3.0",
"vimeo/psalm": "4.7.0",
"vimeo/psalm": "^4.22",
"rector/rector": "^0.11.47"
},
"suggest": {
Expand Down Expand Up @@ -102,8 +102,7 @@
"analyse": [
"@composer validate --strict",
"vendor/bin/ecs check src",
"vendor/bin/phpstan analyse --ansi -c phpstan.neon -l max src",
"vendor/bin/psalm"
"vendor/bin/phpstan analyse --ansi -c phpstan.neon -l max src"
],
"fix": [
"vendor/bin/ecs check src --fix"
Expand Down
7 changes: 7 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
</projectFiles>

<issueHandlers>
<ArgumentTypeCoercion>
<errorLevel type="suppress">
<referencedFunction name="ReflectionClass::getAttributes" />
</errorLevel>
</ArgumentTypeCoercion>

<DeprecatedMethod>
<errorLevel type="suppress">
<referencedMethod name="Symfony\Component\EventDispatcher\Event::isPropagationStopped" />
Expand Down Expand Up @@ -95,6 +101,7 @@

<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<file name="src/Component/Tests/Reflection/ClassReflectionTest.php" />
<file name="src/Bundle/Validator/Constraints/UniqueWithinCollectionConstraint.php" />
<file name="src/Bundle/Validator/Constraints/Enabled.php" />
<file name="src/Bundle/Validator/Constraints/Disabled.php" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

final class TargetEntitiesResolver implements TargetEntitiesResolverInterface
{
public function resolve(array $resources): array
public function resolve(array $resourcesConfiguration): array
{
$interfaces = [];

foreach ($resources as $alias => $configuration) {
foreach ($resourcesConfiguration as $alias => $configuration) {
$model = $this->getModel($alias, $configuration);

$modelInterfaces = class_implements($model) ?: [];
Expand All @@ -43,7 +43,7 @@ public function resolve(array $resources): array
return (string) current($classes);
}, $interfaces);

foreach ($resources as $alias => $configuration) {
foreach ($resourcesConfiguration as $alias => $configuration) {
if (isset($configuration['classes']['interface'])) {
$model = $this->getModel($alias, $configuration);
$interface = $configuration['classes']['interface'];
Expand Down
1 change: 1 addition & 0 deletions src/Bundle/Routing/RouteAttributesFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@

interface RouteAttributesFactoryInterface
{
/** @psalm-param class-string $className */
public function createRouteForClass(RouteCollection $routeCollection, string $className): void;
}
2 changes: 2 additions & 0 deletions src/Component/Reflection/ClassReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public static function getResourcesByPath(string $path): iterable
}

/**
* @psalm-param class-string $className
*
* @return \ReflectionAttribute[]
*/
public static function getClassAttributes(string $className, string $attributeName): array
Expand Down

0 comments on commit a1382f0

Please sign in to comment.