You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do you think about using annotation instead of an extension @dereuromark ?
This would require to add constant in the class and use that as 'template'. The existing property would refer to the new constant: protected static array $_types = self:TYPES;
Activity
rochamarcelo commentedon May 19, 2025
It should be able to understand based on default values of TypeFactory::$_types using an extension, maybe it is also possible with annotations.
rochamarcelo commentedon May 20, 2025
Found this but it is using constant https://phpstan.org/r/a01e1e49-6f05-43a8-aac7-aded770cd88a
dereuromark commentedon May 20, 2025
A manual strategy could be sth like
We should be able to automate this based on Name/Namespace I guess even.
rochamarcelo commentedon May 20, 2025
Could rely on predefined values from $_types, also return null instead of MixedType to fallback to method return type
rochamarcelo commentedon May 20, 2025
What do you think about using annotation instead of an extension @dereuromark ?
This would require to add constant in the class and use that as 'template'. The existing property would refer to the new constant:
protected static array $_types = self:TYPES;Example: https://phpstan.org/r/b7d9e97a-8d3e-4462-8b03-f30ea6942f97
dereuromark commentedon May 20, 2025
Well we are mainly using it in bootstrap
And maybe a few other places.
The extension would just make it work out of the box :)
dereuromark commentedon Oct 15, 2025
#58