Skip to content

Commit

Permalink
get rid of error due to empty data set
Browse files Browse the repository at this point in the history
  • Loading branch information
isfedorov committed Aug 20, 2024
1 parent b559986 commit 258754e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/TestData/Providers/Stubs/StubsParametersProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,17 @@ private static function yieldFilteredMethodParameters(string $classType, callabl
$toYield = array_filter(array_map(
fn ($class) => array_filter(
array_map(
fn(PHPMethod $method) => EntitiesFilter::getFilteredParameters($method, null, ...$problemTypes),
fn(PHPMethod $method) => array_filter(
EntitiesFilter::getFilteredParameters($method, null, ...$problemTypes),
function ($parameter) use ($filterFunction, $class, $method) {
if (!empty($parameter->availableVersionsRangeFromAttribute)) {
$firstSinceVersion = max(ParserUtils::getDeclaredSinceVersion($method), min($parameter->availableVersionsRangeFromAttribute));
} else {
$firstSinceVersion = ParserUtils::getDeclaredSinceVersion($method);
}
return $filterFunction($class, $method, $firstSinceVersion) === true;
}
),
EntitiesFilter::getFilteredMethods($class)
),
fn($parameters) => !empty($parameters)
Expand Down

0 comments on commit 258754e

Please sign in to comment.