Fix the issues reported by phpcs

Created on 14 April 2023, over 1 year ago
Updated 23 June 2024, 6 months ago

Problem/Motivation

FILE: ...ragraphs_asymmetric_translation_widgets-3354154\config\schema\paragraphs_asymmetric_translation_widgets.schema.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
15 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: ...:\xampp\htdocs\backendassignment\web\modules\contrib\paragraphs_asymmetric_translation_widgets-3354154\credits.txt
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
6 | WARNING | Line exceeds 80 characters; contains 441 characters
------------------------------------------------------------------------------------------------------------------------

FILE: ...ampp\htdocs\backendassignment\web\modules\contrib\paragraphs_asymmetric_translation_widgets-3354154\css\widget.css
------------------------------------------------------------------------------------------------------------------------
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: ...modules\contrib\paragraphs_asymmetric_translation_widgets-3354154\paragraphs_asymmetric_translation_widgets.module
------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
37 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: ...trib\paragraphs_asymmetric_translation_widgets-3354154\src\Plugin\Field\FieldWidget\ParagraphsAsymmetricWidget.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: ...ragraphs_asymmetric_translation_widgets-3354154\src\Plugin\Field\FieldWidget\ParagraphsClassicAsymmetricWidget.php
------------------------------------------------------------------------------------------------------------------------
FOUND 74 ERRORS AND 8 WARNINGS AFFECTING 76 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
49 | ERROR | [x] Use null coalesce operator instead of ternary operator.
80 | ERROR | [x] Short array syntax must be used to define arrays
104 | ERROR | [x] Short array syntax must be used to define arrays
176 | ERROR | [x] Short array syntax must be used to define arrays
179 | ERROR | [x] Short array syntax must be used to define arrays
181 | ERROR | [x] Short array syntax must be used to define arrays
181 | ERROR | [x] Short array syntax must be used to define arrays
183 | ERROR | [x] Short array syntax must be used to define arrays
196 | ERROR | [x] Short array syntax must be used to define arrays
199 | ERROR | [x] Short array syntax must be used to define arrays
200 | ERROR | [x] Short array syntax must be used to define arrays
206 | ERROR | [x] Short array syntax must be used to define arrays
209 | ERROR | [x] Short array syntax must be used to define arrays
210 | ERROR | [x] Short array syntax must be used to define arrays
216 | ERROR | [x] Short array syntax must be used to define arrays
220 | ERROR | [x] Short array syntax must be used to define arrays
221 | ERROR | [x] Short array syntax must be used to define arrays
232 | ERROR | [ ] The array declaration extends to column 90 (the limit is 80). The array content should be split up
| | over multiple lines
253 | ERROR | [x] Short array syntax must be used to define arrays
258 | ERROR | [x] Short array syntax must be used to define arrays
258 | ERROR | [x] Short array syntax must be used to define arrays
260 | ERROR | [ ] The array declaration extends to column 92 (the limit is 80). The array content should be split up
| | over multiple lines
261 | ERROR | [x] Short array syntax must be used to define arrays
262 | ERROR | [x] Short array syntax must be used to define arrays
277 | ERROR | [x] Short array syntax must be used to define arrays
279 | ERROR | [x] Short array syntax must be used to define arrays
284 | ERROR | [x] Short array syntax must be used to define arrays
286 | ERROR | [x] Short array syntax must be used to define arrays
291 | ERROR | [x] Short array syntax must be used to define arrays
293 | ERROR | [x] Short array syntax must be used to define arrays
299 | ERROR | [x] Short array syntax must be used to define arrays
304 | ERROR | [x] Short array syntax must be used to define arrays
304 | ERROR | [x] Short array syntax must be used to define arrays
305 | ERROR | [x] Short array syntax must be used to define arrays
305 | ERROR | [ ] The array declaration extends to column 100 (the limit is 80). The array content should be split
| | up over multiple lines
305 | ERROR | [x] Short array syntax must be used to define arrays
307 | ERROR | [x] Short array syntax must be used to define arrays
308 | ERROR | [x] Short array syntax must be used to define arrays
319 | ERROR | [x] Short array syntax must be used to define arrays
321 | ERROR | [x] Short array syntax must be used to define arrays
326 | ERROR | [x] Short array syntax must be used to define arrays
328 | ERROR | [x] Short array syntax must be used to define arrays
333 | ERROR | [x] Short array syntax must be used to define arrays
335 | ERROR | [x] Short array syntax must be used to define arrays
340 | ERROR | [x] Short array syntax must be used to define arrays
342 | ERROR | [x] Short array syntax must be used to define arrays
347 | ERROR | [x] Short array syntax must be used to define arrays
349 | ERROR | [x] Short array syntax must be used to define arrays
357 | ERROR | [ ] The array declaration extends to column 133 (the limit is 80). The array content should be split
| | up over multiple lines
366 | ERROR | [ ] The array declaration extends to column 90 (the limit is 80). The array content should be split up
| | over multiple lines
384 | ERROR | [ ] The array declaration extends to column 90 (the limit is 80). The array content should be split up
| | over multiple lines
399 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
409 | ERROR | [ ] The array declaration extends to column 120 (the limit is 80). The array content should be split
| | up over multiple lines
409 | ERROR | [x] Short array syntax must be used to define arrays
410 | ERROR | [x] Short array syntax must be used to define arrays
414 | ERROR | [x] Short array syntax must be used to define arrays
420 | ERROR | [x] Short array syntax must be used to define arrays
421 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
432 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
447 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
477 | ERROR | [ ] The array declaration extends to column 85 (the limit is 80). The array content should be split up
| | over multiple lines
496 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
499 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
518 | WARNING | [x] A comma should follow the last multiline array item. Found: 'addTranslatabilityClue'
526 | ERROR | [x] Short array syntax must be used to define arrays
538 | ERROR | [x] Short array syntax must be used to define arrays
550 | ERROR | [x] Short array syntax must be used to define arrays
573 | ERROR | [x] Missing function doc comment
600 | WARNING | [x] A comma should follow the last multiline array item. Found: 1
613 | ERROR | [x] Short array syntax must be used to define arrays
614 | ERROR | [x] Short array syntax must be used to define arrays
631 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
633 | ERROR | [x] Short array syntax must be used to define arrays
644 | ERROR | [x] Short array syntax must be used to define arrays
646 | ERROR | [x] Short array syntax must be used to define arrays
648 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
681 | ERROR | [x] Short array syntax must be used to define arrays
706 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
755 | WARNING | [x] '@todo: should we support field collections as well?' should match the format '@todo Fix problem X
| | here.'
780 | ERROR | [x] Expected 1 blank line after function; 0 found
781 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 70 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: ...rib\paragraphs_asymmetric_translation_widgets-3354154\tests\src\Functional\ParagraphsAsymmetricTranslationTest.php
------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
50 | ERROR | [x] Short array syntax must be used to define arrays
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

Time: 8.12 secs; Memory: 10MB

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sidharth_soman
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

    Finding the issues as detailed in the summary upon running the phpcs command on the module. I'll work on fixing them.

  • Merge request !8Fixed phpcs issues. โ†’ (Open) created by sidharth_soman
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

    I have fixed all the issues except for those related to filling in and updating documentation. I have issued an MR for the same. Please review.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    silvi.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 6 months ago
    3 pass
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    Hello, I've fixed below remaining issues, please review.

    FILE: paragraphs_asymmetric_translation_widgets-3354154/tests/src/Functional/ParagraphsAsymmetricTranslationTest.php
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Tests\BrowserTestBase.
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: paragraphs_asymmetric_translation_widgets-3354154/src/Plugin/Field/FieldWidget/ParagraphsClassicAsymmetricWidget.php
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 4 WARNINGS AFFECTING 6 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------
       7 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\Html.
     524 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
     527 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
     601 | ERROR   | [ ] Doc comment is empty
     662 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
     679 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: paragraphs_asymmetric_translation_widgets-3354154/credits.txt
    --------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------
     6 | WARNING | Line exceeds 80 characters; contains 441 characters
    --------------------------------------------------------------------------------------------------------
    
  • Status changed to RTBC 6 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi

    I applied MR !8 and I confirmed that it fixes all PHPCS issues and error

    โžœ  paragraphs_asymmetric_translation_widgets git:(8.x-1.x) curl https://git.drupalcode.org/project/paragraphs_asymmetric_translation_widgets/-/merge_requests/8.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 30626    0 30626    0     0  51925      0 --:--:-- --:--:-- --:--:-- 52531
    patching file 'config/schema/paragraphs_asymmetric_translation_widgets.schema.yml'
    patching file credits.txt
    patching file paragraphs_asymmetric_translation_widgets.module
    patching file 'src/Plugin/Field/FieldWidget/ParagraphsClassicAsymmetricWidget.php'
    patching file 'tests/src/Functional/ParagraphsAsymmetricTranslationTest.php'
    โžœ  paragraphs_asymmetric_translation_widgets git:(8.x-1.x) โœ— ..
    โžœ  contrib git:(main) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml paragraphs_asymmetric_translation_widgets
    โžœ  contrib git:(main) โœ— 
Production build 0.71.5 2024