-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for form fields in containers #380
base: main
Are you sure you want to change the base?
Conversation
self-note |
follow up:
|
I will check in more detail later but I think this can cause some problems.
|
yes, I still think this is much better than actual state where everything is considered to be forms's field, we can improve it in some next PRs - like mentioned above I'm planning to collect container names with variable names and use them to cover these use cases
In actual implementation, it will not work, because variable name will not be the same as container name. It is limitation which is documented. In next implementation with collected couples variable with container name it will not work too because there will be some conflict. Code of application have to be changed or error ignored.
not yet implemented, but it should be the same - just some recursion I want to keep PRs small with only one main change. |
My concern is if it would not cause too many false positives. |
we need to test in real world apps |
I think in our apps on most places container name and variable name would not match and we use containers in containers in many places because we have some custom multi-part inputs (containers with few inputs like comparsion+value, hour+minute, etc.) Maybe to avoid fale positives we should keep falldack to current behaviour (if control is not found in properly named container then it is searched everywhere) |
But original behavior causes many false negatives, that's why I'm reworking it now. Also with multi part inputs and containers in containers I would suggest you to use renderer instead of custom latte rendering |
Maybe make this a optional feature then? I would like to avoid many false positives in defautl behaviour but it is true that ignoring false negatives is also not ideal. |
I have to check, but I think these two solutions are not compatible and it doubles the code we have to support |
Maybe implement it in a way that would optionaly allow fallback. Something like creating "virtual" container '*' and use |
[9 errors remaining](https://github.com/spaze/michalspacek.cz/actions/runs/5562124085/jobs/10160242058) and they all seem to be related one way or another to form containers, so maybe the following will help? - efabrica-team/phpstan-latte#380 Ref #141
…pported I hope these would be solved one day when efabrica-team/phpstan-latte#380 is closed but currently, even when testing that branch, aren't.
Ignoring just errors related to form containers which are not yet (fully) supported. I hope these would be solved one day when efabrica-team/phpstan-latte#380 is closed but currently, even when testing that branch, aren't. Ref #141
Collecting container fields to container based on its name and variable name.
This will work:
This will not work:
because 'foo' !== 'container'