Skip to content

ClassReflection

github-actions edited this page Apr 28, 2026 · 1 revision

Centralizes small reflection lookups used by DevTools runtime metadata.

This helper keeps command discovery code focused on command behavior instead of raw reflection boilerplate.


  • Full name: \FastForward\DevTools\Reflection\ClassReflection
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Methods

isInstantiableSubclassOf

Detects whether a class can be instantiated as a subclass of another class.

public static isInstantiableSubclassOf(class-string $className, class-string $parentClass): bool
  • This method is static. Parameters:
Parameter Type Description
$className class-string the class being inspected
$parentClass class-string the required parent class or interface

Return Value:

true when the class is instantiable and extends or implements the expected parent


getAttributeArguments

Returns the first matching attribute arguments normalized by constructor parameter name.

public static getAttributeArguments(class-string $className, class-string $attributeClass): array<string,mixed>|null

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.

  • This method is static. Parameters:
Parameter Type Description
$className class-string the class being inspected
$attributeClass class-string the attribute class being read

Return Value:

the normalized argument map, or null when the attribute is absent


Clone this wiki locally