diff --git a/src/Repositories/DatasetsRepository.php b/src/Repositories/DatasetsRepository.php index 3deee5bd..0c6b13a8 100644 --- a/src/Repositories/DatasetsRepository.php +++ b/src/Repositories/DatasetsRepository.php @@ -67,11 +67,11 @@ final class DatasetsRepository } /** - * @return Closure|array + * @return array * * @throws ShouldNotHappen */ - public static function get(string $filename, string $description): Closure|array // @phpstan-ignore-line + public static function get(string $filename, string $description): array // @phpstan-ignore-line { $dataset = self::$withs[$filename.self::SEPARATOR.$description]; @@ -191,6 +191,7 @@ final class DatasetsRepository return str_starts_with($currentTestFile, $datasetScope); }, ARRAY_FILTER_USE_KEY); + /** @var string|null $closestScopeDatasetKey */ $closestScopeDatasetKey = array_reduce( array_keys($matchingDatasets), fn (string|int|null $keyA, string|int|null $keyB): string|int|null => $keyA !== null && strlen((string) $keyA) > strlen((string) $keyB) ? $keyA : $keyB