ConstructorParser
class ConstructorParser
Reads a class's methods from its source, such as the constructor its instances run.
Methods
Create a new constructor parser instance.
Find the constructor the class's instances run (its own, an inherited one or a trait's), with the class
declaring it, which parent:: is relative to. A trait's constructor is declared by the class using it.
Find the declaration of the method the class runs under the name (its own, an inherited one or a trait's), with the file declaring it. Null when the class has no such method in source.
Determine whether the constructor the class's instances run may change the property, following
parent::__construct(): an assignment to it or through an array dimension of it, a promoted parameter,
or a call on the instance to one of the given setters.
Details
at line 51
__construct(Parser $parser)
Create a new constructor parser instance.
at line 64
array|null
findConstructor(ClassReflection $classReflection)
Find the constructor the class's instances run (its own, an inherited one or a trait's), with the class
declaring it, which parent:: is relative to. A trait's constructor is declared by the class using it.
Null when there is no constructor in source.
at line 87
array|null
findMethod(ClassReflection $classReflection, string $name)
Find the declaration of the method the class runs under the name (its own, an inherited one or a trait's), with the file declaring it. Null when the class has no such method in source.
at line 128
bool
writesProperty(ClassReflection $classReflection, string $property, array $setters = [])
Determine whether the constructor the class's instances run may change the property, following
parent::__construct(): an assignment to it or through an array dimension of it, a promoted parameter,
or a call on the instance to one of the given setters.
The bodies of the other methods it calls are not read.