-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Remove "Undefined fields" from app folder #11625
Remove "Undefined fields" from app folder #11625
Conversation
@adrian-martinez-interactiv4 are you interested in running "Undefined field" PhpStorm inspection all over the code maybe and fix all "Field declared dynamically" warnings in this PR? I remember there was even some Fatal Error reported due to field not initialized in constructor. |
@orlangur I would suggest that a complete update of "Undefined fields" should be extracted to a separate issue/pr. I see this as a good fix for now and we can improve in steps. |
@dmanners I wouldn't want to process them as 10-20 PRs on the other hand :) Let's wait for the PR author response and if he will not find my suggestion interesting let's maybe report generic |
This PR will try to fix "Undefined fields" from app folder, lib and dev folders will have its own PR. |
ef4069b
to
4805bf2
Compare
@orlangur Hi, commit 9980202 is the main commit of this PR. I've left Magento/Sitemap/Model/Observer.php untouched, because it will be fixed by open PR #11320. About class properties added, visibility has been set according to neighbour properties, and since dynamic declared variables have open visibility, most of defined properties are protected (although some that clearly could be private have been defined so, I already know they all should be private), to ensure the system still works properly. Reviewing if all the protected variables can be changed to private, and make the proper changes if needed is out of the scope of this task. |
7926799
to
9980202
Compare
@orlangur I don't know what Codacy is complaining about: Also, I find static tests have failed due to two types of errors, this one was an existing error: They fail after adding the variable even when The second type: It looks like missing fields may have been left out on purpose to fit the 15 fields limit. Should I suppress warnings for this classes? |
Hi @adrian-martinez-interactiv4, I don't have time to review this PR fully this night but here are the quick answers on your questions:
|
Magento/Sitemap/Model/Observer.php => will be fixed by open PR magento#11320
9980202
to
85bd65c
Compare
@orlangur done |
Hi @adrian-martinez-interactiv4 and @orlangur. What do you think about it? |
Hi @adrian-martinez-interactiv4 , I am closing this PR now due to inactivity. |
Remove "Undefined fields" from app folder
Description
This PR adds missing properties to class, and optimize / reorder imports, under app folder.
Fixed Issues (if relevant)
None, improvement, since it's not really a problem, it makes no sense to backport it.
Manual testing scenarios
Contribution checklist