Skip to content

Commit bc599a5

Browse files
authored
Merge pull request #538 from greg0ire/reduce-baseline
Address static analysis issues from the baselines
2 parents 553a96f + 27b05cc commit bc599a5

6 files changed

+5
-29
lines changed

phpstan-baseline.neon

-15
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

-3
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

-5
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

+1-1
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

+3-3
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

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class DoctrineMigrationsExtension extends Extension
3535
/**
3636
* Responds to the migrations configuration parameter.
3737
*
38-
* @param mixed[][] $configs
39-
* @psalm-param array<string, array<string, array<string, array<string, string>|string>|string>> $configs
38+
* {@inheritDoc}
4039
*/
4140
public function load(array $configs, ContainerBuilder $container): void
4241
{

0 commit comments

Comments
 (0)