Skip to content

Commit 27b05cc

Browse files
committed
Address static analysis issues from the baselines
1 parent dcb2981 commit 27b05cc

File tree

6 files changed

+5
-29
lines changed

6 files changed

+5
-29
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
5-
count: 1
6-
path: src/Collector/MigrationsCollector.php
7-
8-
-
9-
message: "#^Only booleans are allowed in a negated boolean, Doctrine\\\\Migrations\\\\AbstractMigration\\|null given\\.$#"
10-
count: 1
11-
path: src/Collector/MigrationsFlattener.php
12-
13-
-
14-
message: "#^Only booleans are allowed in a ternary operator condition, Doctrine\\\\Migrations\\\\AbstractMigration\\|null given\\.$#"
15-
count: 2
16-
path: src/Collector/MigrationsFlattener.php
17-
183
-
194
message: "#^Call to method setContainer\\(\\) on an unknown class Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareInterface\\.$#"
205
count: 1

phpstan.neon.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ parameters:
99
# That file contains an error that cannot be ignored
1010
- tests/Fixtures/Migrations/ContainerAwareMigration.php
1111

12-
ignoreErrors:
13-
- '~Parameter \#1 \$configs.*DoctrineMigrationsExtension::load.*~'
14-
1512
includes:
1613
- phpstan-baseline.neon
1714
- vendor/phpstan/phpstan-strict-rules/rules.neon

psalm-baseline.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
<code><![CDATA[end]]></code>
66
</UndefinedInterfaceMethod>
77
</file>
8-
<file src="src/DependencyInjection/DoctrineMigrationsExtension.php">
9-
<MoreSpecificImplementedParamType>
10-
<code><![CDATA[$configs]]></code>
11-
</MoreSpecificImplementedParamType>
12-
</file>
138
<file src="src/MigrationsFactory/ContainerAwareMigrationFactory.php">
149
<ContainerDependency>
1510
<code><![CDATA[ContainerInterface $container]]></code>

src/Collector/MigrationsCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(DependencyFactory $dependencyFactory, MigrationsFlat
3232
/** @return void */
3333
public function collect(Request $request, Response $response, ?Throwable $exception = null)
3434
{
35-
if (! empty($this->data)) {
35+
if ($this->data !== []) {
3636
return;
3737
}
3838

src/Collector/MigrationsFlattener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ public function flattenExecutedMigrations(ExecutedMigrationsList $migrationsList
6262
return [
6363
'version' => (string) $migration->getVersion(),
6464
'is_new' => false,
65-
'is_unavailable' => ! $availableMigration,
66-
'description' => $availableMigration ? $availableMigration->getDescription() : null,
65+
'is_unavailable' => $availableMigration === null,
66+
'description' => $availableMigration !== null ? $availableMigration->getDescription() : null,
6767
'executed_at' => $migration->getExecutedAt(),
6868
'execution_time' => $migration->getExecutionTime(),
69-
'file' => $availableMigration ? (new ReflectionClass($availableMigration))->getFileName() : null,
69+
'file' => $availableMigration !== null ? (new ReflectionClass($availableMigration))->getFileName() : null,
7070
];
7171
}, $migrationsList->getItems());
7272
}

src/DependencyInjection/DoctrineMigrationsExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ class DoctrineMigrationsExtension extends Extension
3838
/**
3939
* Responds to the migrations configuration parameter.
4040
*
41-
* @param mixed[][] $configs
42-
* @psalm-param array<string, array<string, array<string, array<string, string>|string>|string>> $configs
41+
* {@inheritDoc}
4342
*/
4443
public function load(array $configs, ContainerBuilder $container): void
4544
{

0 commit comments

Comments
 (0)