Skip to content

Commit

Permalink
Psalm 5
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Nov 13, 2023
1 parent 5071e32 commit f766be6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
8 changes: 4 additions & 4 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ private function getOrganizeMigrationsModes(): array
$constPrefix = 'VERSIONS_ORGANIZATION_';
$prefixLen = strlen($constPrefix);
$refClass = new ReflectionClass('Doctrine\Migrations\Configuration\Configuration');
$constsArray = $refClass->getConstants();
$constsArray = array_keys($refClass->getConstants());
$namesArray = [];

foreach ($constsArray as $key => $value) {
if (strpos($key, $constPrefix) !== 0) {
foreach ($constsArray as $constant) {
if (strpos($constant, $constPrefix) !== 0) {
continue;
}

$namesArray[] = substr($key, $prefixLen);
$namesArray[] = substr($constant, $prefixLen);
}

return $namesArray;
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"phpstan/phpstan-symfony": "^1.3",
"doctrine/orm": "^2.6",
"doctrine/persistence": "^2.0 || ^3 ",
"vimeo/psalm": "^4.22"
"psalm/plugin-phpunit": "^0.18.4",
"psalm/plugin-symfony": "^5",
"vimeo/psalm": "^5.15"
},
"autoload": {
"psr-4": { "Doctrine\\Bundle\\MigrationsBundle\\": "" },
Expand Down
10 changes: 5 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
<file src="DependencyInjection/Configuration.php">
<UndefinedMethod occurrences="1">
<code>root</code>
</UndefinedMethod>
<UndefinedInterfaceMethod>
<code>end</code>
</UndefinedInterfaceMethod>
</file>
<file src="DependencyInjection/DoctrineMigrationsExtension.php">
<MoreSpecificImplementedParamType occurrences="1">
<MoreSpecificImplementedParamType>
<code>$configs</code>
</MoreSpecificImplementedParamType>
</file>
Expand Down
7 changes: 6 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<psalm
errorLevel="4"
phpVersion="8.2"
resolveFromConfigFile="true"
findUnusedBaselineEntry="true"
findUnusedCode="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand All @@ -16,4 +17,8 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin" />
</plugins>
</psalm>

0 comments on commit f766be6

Please sign in to comment.