ClassReflection
Centralizes small reflection lookups used by DevTools runtime metadata.
Description
This helper keeps command discovery code focused on command behavior instead of raw reflection boilerplate.
Methods
Returns the first matching attribute arguments normalized by constructor parameter name.
Detects whether a class can be instantiated as a subclass of another class.
Returns the first matching attribute arguments normalized by constructor parameter name.
public
static
getAttributeArguments(
class-string
$className,
class-string
$attributeClass) : array<string, mixed>|null
Description
Positional arguments are mapped to their constructor parameter names so callers do not need to understand how the attribute was declared at the call site.
Parameters
$className
:
class-string
Description
the class being inspected
$attributeClass
:
class-string
Description
the attribute class being read
Return values
Description
the normalized argument map, or null when the attribute is absent
Detects whether a class can be instantiated as a subclass of another class.
public
static
isInstantiableSubclassOf(
class-string
$className,
class-string
$parentClass) : bool
Parameters
$className
:
class-string
Description
the class being inspected
$parentClass
:
class-string
Description
the required parent class or interface
Return values
Description
true when the class is instantiable and extends or implements the expected parent