slimphp / Twig-View

Slim Framework view helper built on top of the Twig templating component
http://slimframework.com
MIT License
359 stars 87 forks source link

Use late static bindings in factory methods #279

Closed kekalainen closed 4 months ago

kekalainen commented 1 year ago

Use late static bindings in factory methods to facilitate constructing derived classes.

Retained the return types for PHP <8.0 compatibility.

odan commented 4 months ago

Thanks for your contribution. This PR cannot be merged, because the "unsafe" usage of new static(). This change might break once the class is extended, and the constructor is overridden with different parameters.