Skip to content

Commit de8b465

Browse files
authored
Psalm 5 (#517)
1 parent 5071e32 commit de8b465

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

DependencyInjection/Configuration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ private function getOrganizeMigrationsModes(): array
164164
$constPrefix = 'VERSIONS_ORGANIZATION_';
165165
$prefixLen = strlen($constPrefix);
166166
$refClass = new ReflectionClass('Doctrine\Migrations\Configuration\Configuration');
167-
$constsArray = $refClass->getConstants();
167+
$constsArray = array_keys($refClass->getConstants());
168168
$namesArray = [];
169169

170-
foreach ($constsArray as $key => $value) {
171-
if (strpos($key, $constPrefix) !== 0) {
170+
foreach ($constsArray as $constant) {
171+
if (strpos($constant, $constPrefix) !== 0) {
172172
continue;
173173
}
174174

175-
$namesArray[] = substr($key, $prefixLen);
175+
$namesArray[] = substr($constant, $prefixLen);
176176
}
177177

178178
return $namesArray;

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
"phpstan/phpstan-symfony": "^1.3",
3636
"doctrine/orm": "^2.6",
3737
"doctrine/persistence": "^2.0 || ^3 ",
38-
"vimeo/psalm": "^4.22"
38+
"psalm/plugin-phpunit": "^0.18.4",
39+
"psalm/plugin-symfony": "^3 || ^5",
40+
"vimeo/psalm": "^4.30 || ^5.15"
3941
},
4042
"autoload": {
4143
"psr-4": { "Doctrine\\Bundle\\MigrationsBundle\\": "" },

psalm-baseline.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
2+
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
33
<file src="DependencyInjection/Configuration.php">
4-
<UndefinedMethod occurrences="1">
5-
<code>root</code>
6-
</UndefinedMethod>
4+
<UndefinedInterfaceMethod>
5+
<code>end</code>
6+
</UndefinedInterfaceMethod>
77
</file>
88
<file src="DependencyInjection/DoctrineMigrationsExtension.php">
9-
<MoreSpecificImplementedParamType occurrences="1">
9+
<MoreSpecificImplementedParamType>
1010
<code>$configs</code>
1111
</MoreSpecificImplementedParamType>
1212
</file>

psalm.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<psalm
33
errorLevel="4"
44
phpVersion="8.2"
5-
resolveFromConfigFile="true"
5+
findUnusedBaselineEntry="true"
6+
findUnusedCode="true"
67
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
78
xmlns="https://getpsalm.org/schema/config"
89
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
@@ -16,4 +17,8 @@
1617
<directory name="vendor" />
1718
</ignoreFiles>
1819
</projectFiles>
20+
<plugins>
21+
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
22+
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin" />
23+
</plugins>
1924
</psalm>

0 commit comments

Comments
 (0)