FunctionParametersCountCheck
class FunctionParametersCountCheck extends AbstractCallableCheck (View source)
Validates that the number of parameters in stub functions matches reflection.
For each function identified by $entityId the validator:
- Looks up the function in reflection data for the given PHP version.
- Looks up the function in stubs using version-aware selection
(PhpStormStubsElementAvailable
from/toon the function itself). - If the stub function is not found it is silently skipped — existence is EntityExistsCheck's responsibility.
- When both sides are found, the stub parameter list is filtered by version
(PhpStormStubsElementAvailable
from/toon parameters → sinceVersion/removedVersion) and the resulting count is compared with the reflection count.
Parameter version filtering compares removedVersion exclusively (phpVersion < removedVersion), per StubsMetadata::isAvailableIn(). The inclusive reading belongs to
the attribute, not to removedVersion: DefaultAvailableVersionParser converts
to: '7.0' into removedVersion = '7.1', so the parameter is still available in
PHP 7.0 even though the comparison itself is exclusive.
Known problems are supported:
- EntityType::FUNCTION + functionId + 'ParametersCountCheck' → skips the parameter-count check for that specific function.
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, CheckType $checkType, 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