Skip to content

Commit

Permalink
PHPStan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixelshaped committed Jun 4, 2024
1 parent 4a9f26e commit 9981a9a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/FlatMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class FlatMapper
*/
private array $objectsMapping = [];

// TODO for now those are unused
private ?CacheInterface $cacheService = null; // @phpstan-ignore-line
private ?CacheInterface $cacheService = null;
private bool $validateMapping = true;

public function setCacheService(CacheInterface $cacheService): void
Expand Down Expand Up @@ -63,14 +62,14 @@ public function createMapping(string $dtoClassName): void

/**
* @param class-string $dtoClassName
* @param array<class-string, string>|null $objectIdentifiers
* @param array<class-string, array<int|string, null|string>>|null $objectsMapping
* @return array{'objectIdentifiers': array<class-string, string>, "objectsMapping": array<class-string, array<int|string, null|string>>}
*/
private function createMappingRecursive(string $dtoClassName, array& $objectIdentifiers = null, array& $objectsMapping = null): array
{
if($objectIdentifiers === null && $objectsMapping === null) {
$objectIdentifiers = [];
$objectsMapping = [];
}
if($objectIdentifiers === null) $objectIdentifiers = [];
if($objectsMapping === null) $objectsMapping = [];

$objectIdentifiers = array_merge([$dtoClassName => 'RESERVED'], $objectIdentifiers);

Expand Down

0 comments on commit 9981a9a

Please sign in to comment.