As per coding standard documentation at 'https://www.drupal.org/coding-standards/docs', @file tag docblock should not be there in the files that contain a namespaced class/interface/trait, whose file name is the class name with a .php extension.

Comments

nehakhadke created an issue. See original summary.

nehakhadke’s picture

StatusFileSize
new1.15 KB
sam152’s picture

Title: Remove @file tag docblock from all the .php files. » Fix coding standards issues in module
Status: Needs review » Needs work

I prefer to fix all cs violations in a single issue. Here are the rest of them.


FILE: ...ules/better_normalizers/src/BetterNormalizersServiceProvider.php
----------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should
    |         |     not begin with a file doc comment
 31 | ERROR   | [x] Inline comments must end in full-stops,
    |         |     exclamation marks, colons, question marks, or
    |         |     closing parentheses
 54 | WARNING | [ ] Line exceeds 80 characters; contains 129
    |         |     characters
 54 | ERROR   | [x] Inline comments must end in full-stops,
    |         |     exclamation marks, colons, question marks, or
    |         |     closing parentheses
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...rupal/8/modules/better_normalizers/src/Normalizer/EntityStub.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 2 | ERROR | [x] Namespaced classes, interfaces and traits should not
   |       |     begin with a file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...dules/better_normalizers/src/Normalizer/FileEntityNormalizer.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
  2 | ERROR | [x] Namespaced classes, interfaces and traits should
    |       |     not begin with a file doc comment
 56 | ERROR | [x] Expected 1 blank line after function; 0 found
 57 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...modules/better_normalizers/src/Normalizer/FileItemNormalizer.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
  2 | ERROR | [x] Namespaced classes, interfaces and traits should
    |       |     not begin with a file doc comment
 39 | ERROR | [ ] Inline doc block comments are not allowed; use "/*
    |       |     Comment */" or "// Comment" instead
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: .../better_normalizers/src/Normalizer/MenuLinkContentNormalizer.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should
    |       |     not begin with a file doc comment
 56 | ERROR | [x] Expected 1 blank line after function; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...r_normalizers/tests/src/Kernel/MenuLinkContentNormalizerTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
  2 | ERROR   | [x] Namespaced classes, interfaces and traits should
    |         |     not begin with a file doc comment
 15 | WARNING | [x] Unused use statement
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 347ms; Memory: 8Mb

╭─Sam@Sams-MBP ~/Sites/drupal/8/modules/better_normalizers  ‹8.x-1.x›
╰─➤  dpatch https://www.drupal.org/files/issues/remove%40file_2846578_1.patch                                                                                                                           1 ↵
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1182  100  1182    0     0    836      0  0:00:01  0:00:01 --:--:--   836
╭─Sam@Sams-MBP ~/Sites/drupal/8/modules/better_normalizers  ‹8.x-1.x*›
╰─➤  cs

FILE: ...ules/better_normalizers/src/BetterNormalizersServiceProvider.php
----------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
 26 | ERROR   | [x] Inline comments must end in full-stops,
    |         |     exclamation marks, colons, question marks, or
    |         |     closing parentheses
 49 | WARNING | [ ] Line exceeds 80 characters; contains 129
    |         |     characters
 49 | ERROR   | [x] Inline comments must end in full-stops,
    |         |     exclamation marks, colons, question marks, or
    |         |     closing parentheses
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...rupal/8/modules/better_normalizers/src/Normalizer/EntityStub.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 2 | ERROR | [x] Namespaced classes, interfaces and traits should not
   |       |     begin with a file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...dules/better_normalizers/src/Normalizer/FileEntityNormalizer.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 52 | ERROR | [x] Expected 1 blank line after function; 0 found
 53 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...modules/better_normalizers/src/Normalizer/FileItemNormalizer.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 35 | ERROR | Inline doc block comments are not allowed; use "/*
    |       | Comment */" or "// Comment" instead
----------------------------------------------------------------------


FILE: .../better_normalizers/src/Normalizer/MenuLinkContentNormalizer.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should
    |       |     not begin with a file doc comment
 56 | ERROR | [x] Expected 1 blank line after function; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...r_normalizers/tests/src/Kernel/MenuLinkContentNormalizerTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
  2 | ERROR   | [x] Namespaced classes, interfaces and traits should
    |         |     not begin with a file doc comment
 15 | WARNING | [x] Unused use statement
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 288ms; Memory: 8Mb
andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new5.58 KB

Fixed the rest, also removed unused variables with DrupalPractice sniffer

andypost’s picture

Would be great to release next beta cos default_content module gonna depend on it

sam152’s picture

Status: Needs review » Reviewed & tested by the community

The last submitted patch, 2: remove@file_2846578_1.patch, failed testing.

  • andypost committed 74fb2c5 on 8.x-1.x
    Issue #2846578 by nehakhadke, andypost: Fix coding standards issues in...
andypost’s picture

Status: Reviewed & tested by the community » Fixed

Thanx, pushed, will release new beta soon

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.