Skip to content

Commit

Permalink
Address static analysis issues from the baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Mar 27, 2024
1 parent dcb2981 commit 5fe1f6f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 26 deletions.
15 changes: 0 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Collector/MigrationsCollector.php

-
message: "#^Only booleans are allowed in a negated boolean, Doctrine\\\\Migrations\\\\AbstractMigration\\|null given\\.$#"
count: 1
path: src/Collector/MigrationsFlattener.php

-
message: "#^Only booleans are allowed in a ternary operator condition, Doctrine\\\\Migrations\\\\AbstractMigration\\|null given\\.$#"
count: 2
path: src/Collector/MigrationsFlattener.php

-
message: "#^Call to method setContainer\\(\\) on an unknown class Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareInterface\\.$#"
count: 1
Expand Down
5 changes: 0 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
<code><![CDATA[end]]></code>
</UndefinedInterfaceMethod>
</file>
<file src="src/DependencyInjection/DoctrineMigrationsExtension.php">
<MoreSpecificImplementedParamType>
<code><![CDATA[$configs]]></code>
</MoreSpecificImplementedParamType>
</file>
<file src="src/MigrationsFactory/ContainerAwareMigrationFactory.php">
<ContainerDependency>
<code><![CDATA[ContainerInterface $container]]></code>
Expand Down
2 changes: 1 addition & 1 deletion src/Collector/MigrationsCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(DependencyFactory $dependencyFactory, MigrationsFlat
/** @return void */
public function collect(Request $request, Response $response, ?Throwable $exception = null)
{
if (! empty($this->data)) {
if ($this->data !== []) {

Check warning on line 35 in src/Collector/MigrationsCollector.php

View check run for this annotation

Codecov / codecov/patch

src/Collector/MigrationsCollector.php#L35

Added line #L35 was not covered by tests
return;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Collector/MigrationsFlattener.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ public function flattenExecutedMigrations(ExecutedMigrationsList $migrationsList
return [
'version' => (string) $migration->getVersion(),
'is_new' => false,
'is_unavailable' => ! $availableMigration,
'description' => $availableMigration ? $availableMigration->getDescription() : null,
'is_unavailable' => $availableMigration === null,
'description' => $availableMigration !== null ? $availableMigration->getDescription() : null,
'executed_at' => $migration->getExecutedAt(),
'execution_time' => $migration->getExecutionTime(),
'file' => $availableMigration ? (new ReflectionClass($availableMigration))->getFileName() : null,
'file' => $availableMigration !== null ? (new ReflectionClass($availableMigration))->getFileName() : null,
];
}, $migrationsList->getItems());
}
Expand Down
3 changes: 1 addition & 2 deletions src/DependencyInjection/DoctrineMigrationsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class DoctrineMigrationsExtension extends Extension
/**
* Responds to the migrations configuration parameter.
*
* @param mixed[][] $configs
* @psalm-param array<string, array<string, array<string, array<string, string>|string>|string>> $configs
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container): void
{
Expand Down

0 comments on commit 5fe1f6f

Please sign in to comment.