spaze / michalspacek.cz

michalspacek.cz + michalspacek.com + subdomains source code because why not
MIT License
9 stars 5 forks source link

PHPStan Latte `$level++` #141

Closed spaze closed 1 year ago

spaze commented 1 year ago

The app is running PHPStan on level 8 for quite some time already (5cc25c4aa8d106aaa1755bc1fa70796a6f168806) and now even on level 9 #147, so let's see how far I can bring the Latte extensions.

PHPStan Latte Levels and PRs:

Lnil:

L0:

L1:

L2:

L3:

L4:

L5:

L6:

L7:

L8:

L9:

+ Bleeding Edge:

Some 🐛🐛🐛 discovered later by for example newer versions of the PHPStan Latte extension

spaze commented 1 year ago

image

spaze commented 1 year ago

Hey @lulco @MartinMystikJonas look I made it to and past the final boss 🦾

Thanks for creating the extension, looking forward to the next releases. If you want, and think it would be useful, feel free to use this code base for some kind of tests, like regression or so. The license allows it but I wanted to be explicit.

The extension helped me to find some buggy code, like for example that I had a form component and a form container sharing the same name. It worked but probably just by coincidence.

lulco commented 1 year ago

Thanks for using our extension! I wish there were more developers using Nette doing it too. Maybe you can share your experiences O:-)

Ad your error - it is corect to use same name for container and control in it. Extension reports it because of its actual implementation which is hacky. We are trying to improve it step by step.

spaze commented 1 year ago

Interesting, having a form container and a field with the same name felt wrong (because of accessing it with $form[foo]) even though it worked, probably because the field is inside the container sharing the same name, not on the same level.

Anyway, this was an easy change, unlike some other refactoring (which should have been done much much earlier but I was lazy and didn't have the right tools available).

lulco commented 1 year ago

Interesting, having a form container and a field with the same name felt wrong (because of accessing it with $form[foo])

This is kind of transformation we have done to make forms work with extension. The original compiled template is different.

Anyway, this was an easy change, unlike some other refactoring (which should have been done much much earlier but I was lazy and didn't have the right tools available).

spaze commented 1 year ago

This is kind of transformation we have done to make forms work with extension. The original compiled template is different.

Good to know this can also be somehow changed!