Skip to content

Commit

Permalink
Fix psalm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky committed Dec 16, 2023
1 parent 4d7352a commit 7290b3a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions DataCollector/DoctrineDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ public function __construct(ManagerRegistry $registry, bool $shouldValidateSchem
$this->registry = $registry;
$this->shouldValidateSchema = $shouldValidateSchema;

if ($debugDataHolder === null) {
parent::__construct($registry);
} else {
parent::__construct($registry, $debugDataHolder);
}
parent::__construct($registry, $debugDataHolder);
}

public function collect(Request $request, Response $response, ?Throwable $exception = null): void
Expand Down
1 change: 0 additions & 1 deletion DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,6 @@ protected function loadOrmEntityManagerMappingInformation(array $entityManager,
$mappingService = $this->getObjectManagerElementName($entityManager['name'] . '_' . $driverType . '_metadata_driver');
$mappingDriverDef = $container->getDefinition($mappingService);
$args = $mappingDriverDef->getArguments();
/** @psalm-suppress TypeDoesNotContainType $this->drivers is set by $this->loadMappingInformation() call */
if ($driverType === 'annotation') {
$args[2] = $entityManager['report_fields_where_declared'];
} elseif ($driverType === 'attribute') {
Expand Down
2 changes: 0 additions & 2 deletions Mapping/DisconnectedMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ public function findNamespaceAndPathForMetadata(ClassMetadataCollection $metadat
$ns = $r->getNamespaceName();
} elseif ($path) {
// Get namespace by removing the last component of the FQCN
/** @psalm-suppress NoValue */
$nsParts = explode('\\', $all[0]->name);
array_pop($nsParts);
$ns = implode('\\', $nsParts);
} else {
/** @psalm-suppress NoValue */
throw new RuntimeException(sprintf('Unable to determine where to save the "%s" class (use the --path option).', $all[0]->name));
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/ProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function setUp(): void

if (class_exists(CodeExtension::class)) {
$this->twig->addExtension(new CodeExtension('', '', ''));
} else {
} elseif (class_exists(CodeExtensionLegacy::class)) {
$this->twig->addExtension(new CodeExtensionLegacy('', '', ''));
}

Expand Down

0 comments on commit 7290b3a

Please sign in to comment.