TYPO3 / Fluid

Fluid template rendering engine - Standalone version
GNU Lesser General Public License v3.0
151 stars 93 forks source link

[TASK] Tune RenderingContext withAttribute() and getAttribute() #882

Closed lolli42 closed 2 months ago

lolli42 commented 2 months ago

getAttribute($className) now always returns an instance of $className, or throws. This avoids checking the returned instance and helps with type hinting in IDEs.

s2b commented 2 months ago

I can confirm that code completion works in my VSCode setup:

genericsCodeCompletion

Due to a bug in PhpStorm, we can't test this, but we can expect it to work there, too.

lolli42 commented 2 months ago

phpstorm issue: https://youtrack.jetbrains.com/issue/WI-75368/class-stringT-does-not-infer-the-right-type