-
-
Notifications
You must be signed in to change notification settings - Fork 303
Open
Labels
bugSomething isn't workingSomething isn't workingkind/frameworkIssues related to CLI app frameworkIssues related to CLI app framework
Description
This piece of code tries to get the options
property from a class within the stack trace.
$options = $reflection->getProperty('options')->getValue(); |
This code will always produce a TypeError with an error message like this:
Fatal error: Uncaught TypeError: ReflectionProperty::getValue(): Argument #1 ($object) must be provided for instance properties in ...
While the first parameter of ReflectionProperty::getValue()
is technically optional, it can actually only be omitted, if the property is static. But \SPC\builder\BuilderBase::$options
is in fact not static.
protected array $options = []; |
As far as I know, the actual object of that class is not accessible from a stack trace. So, I suggest to make the property static. As I understand it, there will not be multiple instances of \SPC\builder\BuilderBase
anyway, since the instance is determined once per execution.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingkind/frameworkIssues related to CLI app frameworkIssues related to CLI app framework