ParameterNamesCheck
class ParameterNamesCheck extends AbstractCallableCheck (View source)
Validates that parameter names in stub functions/methods match those in reflection.
Named parameters were introduced in PHP 8.0, so this check only applies to PHP >= 8.0.
Algorithm:
- Look up the callable in both reflection and stubs using findCallable().
- If not found in stubs, silently succeed — FunctionExistsCheck handles existence.
- Filter and deduplicate stub parameters by version (merges same-named variadic pairs).
- If parameter counts differ, silently succeed — ParametersCountCheck handles that.
- Compare names positionally; collect all mismatches into one failure message.
Known problems are supported via EntityType::FUNCTION / EntityType::METHOD (auto-detected from the entityId format) with checkName 'ParameterNamesCheck'.
Properties
| protected ReflectionProviderInterface | $reflectionProvider | from AbstractReflectionCheck | |
| protected KnownProblemsRegistry | $knownProblemsRegistry | from AbstractReflectionCheck | |
| protected EntityLookupService | $entityLookup | from AbstractCallableCheck |
Methods
No description
Records a skipped-success result if a known problem covers this entity, and returns true.
Find a function or method in the given storage.
No description
Details
__construct(ReflectionProviderInterface|null $reflectionProvider = null, KnownProblemsRegistry|null $knownProblemsRegistry = null, EntityLookupService|null $entityLookup = null)
No description
protected bool
skipWithKnownProblem(CheckResultSet $results, string $entityType, string $entityId, string $checkName, string $phpVersion)
Records a skipped-success result if a known problem covers this entity, and returns true.
Returns false if validation should proceed normally.
protected PHPFunction|null
findCallable(StubDataQueryInterface $storage, string $entityId, string $phpVersion)
Find a function or method in the given storage.
bool
supports(string $phpVersion)
No description
CheckResultSet
run(StubDataQueryInterface $stubs, string $entityId, string $phpVersion)
No description