-
Notifications
You must be signed in to change notification settings - Fork 160
Create phpcs static check for DiConfigTest #233
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
Create phpcs static check for DiConfigTest #233
Conversation
- DiConfigTest: Test for obsolete nodes in di.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request @loginesta ! Can you please verify the test functionality running it against the Magento code with changed di.xml files?
- Add missing composer.lock
Co-authored-by: Sergii Ivashchenko <[email protected]>
- Run composer update --lock
- Fix return type
- Update XML files
- Refactor: Simplify approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @loginesta ! Please see my comments
{ | ||
private const WARNING_CODE = 'FoundObsoleteAttribute'; | ||
|
||
private $xpathObsoleteElems = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would renamve this property as it's not xpath anymore, also it would be good to add a phpdoc
private $xpathObsoleteElems = [ | |
private $obsoleteDiNodes = [ |
{ | ||
$lineContent = $phpcsFile->getTokensAsString($stackPtr, 1); | ||
|
||
foreach ($this->xpathObsoleteElems as $elem => $message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good pratice to use whole words for variables naming
foreach ($this->xpathObsoleteElems as $elem => $message) { | |
foreach ($this->xpathObsoleteElems as $element => $message) { |
- Refactor: Rename variables and add phpdoc
@magento import pr to magento-commerce/magento-coding-standard |
@sivaschenko the pull request successfully imported. |
…o-coding-standard-453 [Imported] Update supported PHP versions
This sniffer looks for occurrences of obsolete nodes:
param
,instance
,array
,item[@key]
andvalue
.Returns a warning for each occurrence found.
https://jira.corp.magento.com/browse/AC-660