Problem/Motivation
Getting Following errors/warnings
$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml bundle_reference
FILE: ...dle_reference\src\Plugin\Field\FieldFormatter\BundleReferenceFormatter.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...p\task\bundle_reference\src\Plugin\Field\FieldType\BundleReferenceItem.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
84 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
87 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...sk\bundle_reference\src\Plugin\Field\FieldWidget\BundleReferenceWidget.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
89 | ERROR | [x] list(...) is forbidden, use [...] instead.
103 | ERROR | [x] Use null coalesce operator instead of ternary operator.
134 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 556ms; Memory: 10MB
Proposed resolution
Fix the errors and warnings.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | bundle_reference-3339857-phpcs_status.png | 21.14 KB | nilesh.addweb |
| #10 | bundle_reference-3339857-applied_patch.png | 66.32 KB | nilesh.addweb |
Issue fork bundle_reference-3339857
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jay jangid commentedCreated MR , please review.
Thank you.
Comment #4
raubi gaur commentedComment #5
raubi gaur commentedThanks @Jay Jangid this mr solved above error.LGTM
Moved to rtbc.
Comment #6
raubi gaur commentedComment #8
pinesh commentedComment #9
nilesh.addweb commentedComment #10
nilesh.addweb commentedHello,
I have applied the patch cleanly, and the above errors are resolved.
Please check the Screenshots for the same.
Comment #11
nilesh.addweb commentedComment #14
pinesh commentedThank you all for your valuable contribution.
Comment #15
pinesh commented