class FunctionParameterDefaultValueCheck extends AbstractCallableCheck (View source)

Validates that default parameter values in stub functions match those in reflection.

Only runs against the latest PHP version since stubs do not support version-aware default values (no LanguageLevelTypeAware equivalent for defaults).

For each function identified by $entityId the validator:

  1. Looks up the function in reflection and stubs.
  2. If the stub function is not found it is silently skipped — existence is FunctionExistsCheck's responsibility.
  3. For each reflection parameter with an accessible default, checks whether the matching stub parameter (by name) declares the same evaluated default.
  4. Comparison is skipped when either side's value is null (see class-level check docs for the rationale).

Known problems are supported at function level:

  • EntityType::FUNCTION + functionId + 'ParameterDefaultValueCheck'

Properties

protected ReflectionProviderInterface $reflectionProvider from  AbstractReflectionCheck
protected KnownProblemsRegistry $knownProblemsRegistry from  AbstractReflectionCheck
protected EntityLookupService $entityLookup from  AbstractCallableCheck

Methods

__construct(ReflectionProviderInterface|null $reflectionProvider = null, KnownProblemsRegistry|null $knownProblemsRegistry = null, EntityLookupService|null $entityLookup = null)

No description

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.

findCallable(StubDataQueryInterface $storage, string $entityId, string $phpVersion)

Find a function or method in the given storage.

bool
supports(string $phpVersion)

No description

run(StubDataQueryInterface $stubs, string $entityId, string $phpVersion)

No description

Details

__construct(ReflectionProviderInterface|null $reflectionProvider = null, KnownProblemsRegistry|null $knownProblemsRegistry = null, EntityLookupService|null $entityLookup = null)

No description

Parameters

ReflectionProviderInterface|null $reflectionProvider
KnownProblemsRegistry|null $knownProblemsRegistry
EntityLookupService|null $entityLookup

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.

Parameters

CheckResultSet $results
string $entityType
string $entityId
string $checkName
string $phpVersion

Return Value

bool

protected PHPFunction|null findCallable(StubDataQueryInterface $storage, string $entityId, string $phpVersion)

Find a function or method in the given storage.

Parameters

StubDataQueryInterface $storage
string $entityId

Format: "functionName" or "ClassName::methodName"

string $phpVersion

Return Value

PHPFunction|null

bool supports(string $phpVersion)

No description

Parameters

string $phpVersion

Return Value

bool

CheckResultSet run(StubDataQueryInterface $stubs, string $entityId, string $phpVersion)

No description

Parameters

StubDataQueryInterface $stubs

Parsed stubs data

string $entityId

Entity identifier to validate

string $phpVersion

PHP version string

Return Value

CheckResultSet