The code contains basic formatting issues which should be fixed.

  1. Lines longer than 80 characters
  2. @todo messages that do not follow the standard message
  3. Missing commas
  4. Lines not correctly indented

Issue fork entity-3331201

Command icon 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

sahil.goyal created an issue. See original summary.

sahil.goyal’s picture

Status: Active » Needs review
StatusFileSize
new21.74 KB

Resolving the PHPCS Errors those needs to be. even though there are still some phpcs issue are shown but i don't think those need need to be update, as it seen alright i let them be there, if find some changes to be done please revert anytime.

tr’s picture

Version: 8.x-1.4 » 8.x-1.x-dev
Status: Needs review » Needs work

Most of those issues in the output that you posted are because you didn't run PHPCS on the HEAD of the branch, but rather on a packaged distribution of this module.

We don't actually need to see all your output - the current coding standards issues are shown in the test output found on the project page under the "Automated testing" tab.

It is far more useful, to me, to restrict your fixes to one type of coding standard problem in each patch.

Your patch doesn't apply because the format is wrong. Specifically the path is wrong for each of the chunks. Your patch has (for example) diff --git a/modules/contrib/entity/README.txt b/modules/contrib/entity/README.txt as the first line, but this should be diff --git a/README.txt b/README.txt and likewise for every chunk in the patch.

Changes like:

+/**
+ *
+ */
 class QueryAccessSubscriber implements EventSubscriberInterface {

and

+/**
+ * {@inheritdoc}
+ */
 class BundleEntityDuplicator implements BundleEntityDuplicatorInterface {

are wrong. If the class is missing documentation, you have to write the documentation.

Also, when you break up lines that are too long, you need to pay attention to the coding standards. The point is not just to make the lines shorter, but to make them easier to read. Breaking them at random places without adding in the expected indentation actually makes things worse. For example:

-        'title' => $this->t('@label (@name:delta)', ['@label' => $label, '@name' => $field_name]),
+        'title' => $this->t('@label (@name:delta)',
+        ['@label' => $label, '@name' => $field_name]),
         'title short' => $this->t('@label:delta', ['@label' => $label]),
       ];

Should be:

-        'title' => $this->t('@label (@name:delta)', ['@label' => $label, '@name' => $field_name]),
+        'title' => $this->t('@label (@name:delta)', [
+          '@label' => $label,
+          '@name' => $field_name,
+        ]),
         'title short' => $this->t('@label:delta', ['@label' => $label]),
       ];
ayush.khare’s picture

Status: Needs work » Needs review
StatusFileSize
new19.3 KB

Fixed #2.

sidharth_soman made their first commit to this issue’s fork.

sidharth_soman’s picture

StatusFileSize
new13.28 KB

@ayush.khare's patch applied cleanly and resolved most of the errors. The only ones remaining are array indentation and doc comment formatting stuff along with some unused variables. If it's better to leave the indentation and formatting as it is for readability purposes, then I think this is good enough for RTBC. Waiting for a confirmation, @TR.

himanshu_jhaloya’s picture

Assigned: Unassigned » himanshu_jhaloya
himanshu_jhaloya’s picture

StatusFileSize
new34.66 KB

Improved the code phpcs

himanshu_jhaloya’s picture

Assigned: himanshu_jhaloya » Unassigned
nayana_mvr’s picture

StatusFileSize
new11.51 KB

Verified the patch #8 and tested it on Drupal version 10.1.x and Entity version 8.x-1.x. The patch applied cleanly but there are few more issues found.

FILE: ../entity/tests/src/Unit/QueryAccess/ConditionTest.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------
 15 | ERROR | Doc comment short description must start with a capital letter
 24 | ERROR | Doc comment short description must start with a capital letter
 27 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
-----------------------------------------------------------------------------------------------------------------------


FILE: ../entity/tests/src/Unit/UncacheableEntityAccessControlHandlerTest.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------------------------
 102 | ERROR | [x] Array indentation error, expected 8 spaces but found 7
 103 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
 106 | ERROR | [x] Array indentation error, expected 8 spaces but found 7
 107 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/tests/src/Kernel/QueryAccess/ConditionGroupTest.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------
 21 | ERROR | Doc comment short description must start with a capital letter
 24 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
------------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/Form/DeleteMultipleForm.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
 12 | ERROR | The text '@deprecated Use \Drupal\Core\Entity\Form\DeleteMultipleForm instead.' does not match the standard format: @deprecated in
    |       | %deprecation-version% and is removed from %removal-version%. %extra-info%.
 12 | ERROR | Each @deprecated tag must have a @see tag immediately following it
--------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/Form/RevisionableContentEntityForm.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------
  14 | ERROR | The text '@deprecated Use \Drupal\Core\Entity\ContentEntityForm instead.' does not match the standard format: @deprecated in
     |       | %deprecation-version% and is removed from %removal-version%. %extra-info%.
  14 | ERROR | Each @deprecated tag must have a @see tag immediately following it
 132 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
 135 | ERROR | The array declaration extends to column 111 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/Entity/RevisionableEntityBundleInterface.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------
  9 | ERROR | Missing short description in doc comment
 10 | ERROR | The text '@deprecated in favor of \Drupal\Core\Entity\RevisionableEntityBundleInterface. Use that instead.' does not match the standard format:
    |       | @deprecated in %deprecation-version% and is removed from %removal-version%. %extra-info%.
 10 | ERROR | Each @deprecated tag must have a @see tag immediately following it
--------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/QueryAccess/QueryAccessEvent.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
 64 | ERROR | The trigger_error message 'The $entity_type_id argument must be passed to QueryAccessEvent::__construct(), it is required before entity:2.0.0.
    |       | See https://www.drupal.org/node/3134363.' does not match the relaxed standard format: %thing% is deprecated in %deprecation-version% any free
    |       | text %removal-version%. %extra-info%. See %cr-link%
--------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/Plugin/Action/Derivative/DeleteActionDeriver.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
 15 | ERROR | The text '@deprecated ' does not match the standard format: @deprecated in %deprecation-version% and is removed from %removal-version%.
    |       | %extra-info%.
 15 | ERROR | Each @deprecated tag must have a @see tag immediately following it
--------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/Plugin/Action/DeleteAction.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
 12 | ERROR | The text '@deprecated Use "entity:delete_action" instead.' does not match the standard format: @deprecated in %deprecation-version% and is
    |       | removed from %removal-version%. %extra-info%.
 12 | ERROR | Each @deprecated tag must have a @see tag immediately following it
--------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/Controller/RevisionOverviewController.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 40 | ERROR | Parameter $renderer is not described in comment
------------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/Controller/RevisionControllerTrait.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
 96 | ERROR | Description for the @return value is missing
---------------------------------------------------------------------------------------------------------------------


FILE: ../entity/src/EntityViewBuilder.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
 12 | ERROR | The text '@deprecated in favor of \Drupal\Core\Entity\EntityViewBuilder. Use that instead.' does not match the standard format: @deprecated in
    |       | %deprecation-version% and is removed from %removal-version%. %extra-info%.
 12 | ERROR | Each @deprecated tag must have a @see tag immediately following it
--------------------------------------------------------------------------------------------------------------------------------------------------------------

..//Users/nayana.ramakrishnan/Documents/drupal10/modules/contrib/entity/src/Routing/DeleteMultipleRouteProvider.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
 13 | ERROR | The text '@deprecated Since Drupal 8.6.x the core DefaultHtmlRouteProvider provides the route for any entity type with a "delete-multiple-form"
    |       | link template and a "delete-multiple-confirm" form.' does not match the standard format: @deprecated in %deprecation-version% and is removed
    |       | from %removal-version%. %extra-info%.
 13 | ERROR | Each @deprecated tag must have a @see tag immediately following it
--------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 1.46 secs; Memory: 14MB
nayana_mvr’s picture

avpaderno’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix the issues reported by phpcs
Priority: Normal » Minor
Status: Needs review » Needs work
Issue tags: +Coding standards, +Needs issue summary update

The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

ashutosh ahirwal’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update

Issue summary updated please review.

tr’s picture

Status: Needs review » Needs work

The issue summary is quite wrong still. Read what I said in #3. All of that extended output needs to be removed because it's wrong and misleading, and the summary needs a link to the test output and a list of coding standards the patch is intended to fix.

While there are some changes in the patch that are ready to commit, most of the patch is still not ready for the reasons I spelled out in #3. And specifically, because all these unrelated issues are lumped together into one big patch, it can't be committed until all the things are fixed.

Coding standards can point out things that need to be improved, like missing documentation comments. But the proper fix is NEVER to just put an empty or placeholder comment in there to make the errors go away. If the documentation comment is missing, then write the documentation. If the class is missing a class documentation comment, don't just put in the class name - that doesn't give us any information we don't already know, does not help anyone trying to understand the code, etc. It just makes the error disappear, which ensures that no one will every go back and fix it. If you're going to add documentation comments, do it right or not at all.

There are also new problems in the latest patch #8 which weren't in the original patch I commented on. Things like:

-  protected function buildMockEntity(EntityTypeInterface $entity_type, $owner_id = NULL, $bundle = NULL, $published = NULL) {
+  protected function buildMockEntity(EntityTypeInterface $entity_type,
+  $owner_id = NULL,
+  $bundle = NULL,
+  $published = NULL) {

which is just plain wrong. That original line does not need to be changed at all, and the "fix" makes the code worse.

rohit.rawat619’s picture

Assigned: Unassigned » rohit.rawat619
Status: Needs work » Active
rohit.rawat619’s picture

Assigned: rohit.rawat619 » Unassigned
Status: Active » Needs review
StatusFileSize
new11.75 KB
tr’s picture

Status: Needs review » Needs work

Please read what I wrote in #14.

capysara’s picture

Assigned: Unassigned » capysara
Issue summary: View changes
capysara’s picture

Issue summary: View changes
capysara’s picture

Issue summary: View changes

capysara’s picture

Title: Fix the issues reported by phpcs » Update formatting for phpcs coding standards
Assigned: capysara » Unassigned
Status: Needs work » Needs review

Added MR for minor formatting updates.
Hiding patches to avoid confusion.

a.aaronjake’s picture

Status: Needs review » Needs work

Hi @everyone,

Applied the changes committed on MR!29, some files failed to apply, might be the reason the errors below were reported. Please see:

entity git:(8.x-1.x) curl https://git.drupalcode.org/project/entity/-/merge_requests/29.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24110    0 24110    0     0  12420      0 --:--:--  0:00:01 --:--:-- 12505
patching file README.txt
patching file entity.module
patching file src/Access/EntityRevisionRouteAccessChecker.php
patching file src/Controller/RevisionOverviewController.php
patching file src/EntityViewsData.php
patching file src/Form/RevisionRevertForm.php
patching file src/Form/RevisionableContentEntityForm.php
patching file tests/src/Functional/Menu/EntityLocalTaskTest.php
patching file tests/src/Kernel/BundlePluginTest.php
patching file tests/src/Kernel/QueryAccess/EventOnlyQueryAccessHandlerTest.php
patching file tests/src/Kernel/QueryAccess/UncacheableQueryAccessHandlerTest.php
patching file tests/src/Unit/EntityAccessControlHandlerTest.php
Hunk #1 FAILED at 89.
Hunk #2 FAILED at 124.
Hunk #3 FAILED at 147.
Hunk #4 FAILED at 181.
Hunk #5 FAILED at 291.
5 out of 5 hunks FAILED -- saving rejects to file tests/src/Unit/EntityAccessControlHandlerTest.php.rej
patching file tests/src/Unit/UncacheableEntityAccessControlHandlerTest.php
Hunk #1 succeeded at 100 with fuzz 2 (offset 2 lines).
➜  entity 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,twig entity

FILE: ...odules/entity_module_bundle_plugin_test/src/Plugin/BundlePluginTest/First.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong
   |       |     one is Drupal\Core\Plugin\PluginBase.
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: .../modules/entity_module_bundle_plugin_test/src/Annotation/BundlePluginTest.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 30 | ERROR | The @var tag must be the first tag in a member variable comment
-----------------------------------------------------------------------------------


FILE: ...ity_module_bundle_plugin_examples_test/src/Plugin/BundlePluginTest/Second.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong
   |       |     one is Drupal\Core\Plugin\PluginBase.
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...les/contrib/entity/tests/modules/entity_module_test/entity_module_test.module
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...s/contrib/entity/tests/modules/entity_module_test/entity_module_test.info.yml
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 1 | WARNING | "Description" property is missing in the info.yml file
-----------------------------------------------------------------------------------


FILE: ...ntrib/entity/tests/modules/entity_module_test/src/Form/EnhancedEntityForm.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 9 | ERROR | [x] Missing class doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...ests/modules/entity_module_test/src/EventSubscriber/QueryAccessSubscriber.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------
  10 | ERROR   | [x] Missing class doc comment
  97 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
     |         |     injection instead
 101 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
     |         |     injection instead
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...odules/contrib/entity/tests/src/Unit/BundleEntityAccessControlHandlerTest.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 9 | WARNING | [x] Unused use statement
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...ue/web/modules/contrib/entity/tests/src/Unit/EntityPermissionProviderTest.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 5 | WARNING | [x] Unused use statement
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: .../web/modules/contrib/entity/tests/src/Unit/EntityAccessControlHandlerTest.php
-----------------------------------------------------------------------------------
FOUND 20 ERRORS AND 1 WARNING AFFECTING 17 LINES
-----------------------------------------------------------------------------------
  10 | WARNING | [x] Unused use statement
 117 | ERROR   | [ ] The array declaration extends to column 151 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 118 | ERROR   | [ ] The array declaration extends to column 154 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 128 | ERROR   | [ ] The array declaration extends to column 149 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 128 | ERROR   | [ ] The array declaration extends to column 148 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 129 | ERROR   | [ ] The array declaration extends to column 152 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 129 | ERROR   | [ ] The array declaration extends to column 151 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 130 | ERROR   | [ ] The array declaration extends to column 141 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 144 | ERROR   | [ ] The array declaration extends to column 130 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 145 | ERROR   | [ ] The array declaration extends to column 132 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 149 | ERROR   | [ ] The array declaration extends to column 132 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 150 | ERROR   | [ ] The array declaration extends to column 135 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 151 | ERROR   | [ ] The array declaration extends to column 121 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 154 | ERROR   | [ ] The array declaration extends to column 131 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 155 | ERROR   | [ ] The array declaration extends to column 133 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 156 | ERROR   | [ ] The array declaration extends to column 138 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 156 | ERROR   | [ ] The array declaration extends to column 137 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 159 | ERROR   | [ ] The array declaration extends to column 133 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 160 | ERROR   | [ ] The array declaration extends to column 135 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 161 | ERROR   | [ ] The array declaration extends to column 141 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 161 | ERROR   | [ ] The array declaration extends to column 140 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...issue/web/modules/contrib/entity/tests/src/Unit/QueryAccess/ConditionTest.php
-----------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------
 15 | ERROR | Doc comment short description must start with a capital letter
 24 | ERROR | Doc comment short description must start with a capital letter
 27 | ERROR | Doc comment short description must be on a single line, further text
    |       | should be a separate paragraph
-----------------------------------------------------------------------------------


FILE: ...modules/contrib/entity/tests/src/Functional/BulkFormEntityListBuilderTest.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------
  56 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 137 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 180 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...rib/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessHandlerTest.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 46 | WARNING | Unused variable $admin_user.
-----------------------------------------------------------------------------------


FILE: ...es/contrib/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessTest.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 58 | WARNING | Unused variable $admin_user.
-----------------------------------------------------------------------------------


FILE: ...eb/modules/contrib/entity/tests/src/Kernel/QueryAccess/ConditionGroupTest.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
 21 | ERROR | Doc comment short description must start with a capital letter
 24 | ERROR | Doc comment short description must be on a single line, further text
    |       | should be a separate paragraph
-----------------------------------------------------------------------------------


FILE: ...odules/contrib/entity/tests/src/Kernel/QueryAccess/QueryAccessHandlerTest.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 46 | WARNING | Unused variable $admin_user.
-----------------------------------------------------------------------------------


FILE: .../modules/contrib/entity/tests/src/Kernel/QueryAccess/QueryAccessEventTest.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 39 | WARNING | Unused variable $admin_user.
-----------------------------------------------------------------------------------


FILE: ...e/web/modules/contrib/entity/tests/src/Kernel/QueryAccess/QueryAccessTest.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 58 | WARNING | Unused variable $admin_user.
-----------------------------------------------------------------------------------


FILE: ...-orgissue/web/modules/contrib/entity/tests/src/Kernel/RevisionBasicUITest.php
-----------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------
  11 | ERROR | [ ] Missing short description in doc comment
 124 | ERROR | [x] Missing function doc comment
 183 | ERROR | [x] Missing function doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...metInterns/Demo-site/drupal-orgissue/web/modules/contrib/entity/entity.module
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
 77 | WARNING | [x] The variable name should be defined after the type
 78 | WARNING | [ ] Unused variable $entity_type_id.
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...Interns/Demo-site/drupal-orgissue/web/modules/contrib/entity/entity.views.inc
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: .../drupal-orgissue/web/modules/contrib/entity/src/BulkFormEntityListBuilder.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 39 | ERROR | The @var tag must be the first tag in a member variable comment
-----------------------------------------------------------------------------------


FILE: ...te/drupal-orgissue/web/modules/contrib/entity/src/Form/DeleteMultipleForm.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 12 | ERROR | The text '@deprecated Use
    |       | \Drupal\Core\Entity\Form\DeleteMultipleForm instead.' does not match
    |       | the standard format: @deprecated in %deprecation-version% and is
    |       | removed from %removal-version%. %extra-info%.
 12 | ERROR | Each @deprecated tag must have a @see tag immediately following it
-----------------------------------------------------------------------------------


FILE: ...rgissue/web/modules/contrib/entity/src/Form/RevisionableContentEntityForm.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 14 | ERROR | The text '@deprecated Use \Drupal\Core\Entity\ContentEntityForm
    |       | instead.' does not match the standard format: @deprecated in
    |       | %deprecation-version% and is removed from %removal-version%.
    |       | %extra-info%.
 14 | ERROR | Each @deprecated tag must have a @see tag immediately following it
-----------------------------------------------------------------------------------


FILE: ...te/drupal-orgissue/web/modules/contrib/entity/src/Form/RevisionRevertForm.php
-----------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------
  10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong
     |       |     one is Drupal\Core\Entity\RevisionLogInterface.
  14 | ERROR | [x] Missing class doc comment
 170 | ERROR | [ ] Description for the @return value is missing
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...ue/web/modules/contrib/entity/src/Access/EntityRevisionRouteAccessChecker.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
 19 | ERROR | [ ] Missing short description in doc comment
 60 | ERROR | [x] list(...) is forbidden, use [...] instead.
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...e/web/modules/contrib/entity/src/Entity/RevisionableEntityBundleInterface.php
-----------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
  9 | ERROR | Missing short description in doc comment
 10 | ERROR | The text '@deprecated in favor of
    |       | \Drupal\Core\Entity\RevisionableEntityBundleInterface. Use that
    |       | instead.' does not match the standard format: @deprecated in
    |       | %deprecation-version% and is removed from %removal-version%.
    |       | %extra-info%.
 10 | ERROR | Each @deprecated tag must have a @see tag immediately following it
-----------------------------------------------------------------------------------


FILE: ...rupal-orgissue/web/modules/contrib/entity/src/QueryAccess/ViewsQueryAlter.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 167 | ERROR | [x] list(...) is forbidden, use [...] instead.
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...upal-orgissue/web/modules/contrib/entity/src/QueryAccess/QueryAccessEvent.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
  6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong
    |       |     one is Drupal\Component\EventDispatcher\Event.
 64 | ERROR | [ ] The trigger_error message 'The $entity_type_id argument must be
    |       |     passed to QueryAccessEvent::__construct(), it is required before
    |       |     entity:2.0.0. See https://www.drupal.org/node/3134363.' does not
    |       |     match the relaxed standard format: %thing% is deprecated in
    |       |     %deprecation-version% any free text %removal-version%.
    |       |     %extra-info%. See %cr-link%
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...issue/web/modules/contrib/entity/src/Plugin/Derivative/EntityTasksDeriver.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 44 | WARNING | Unused variable $entity_type_id.
-----------------------------------------------------------------------------------


FILE: ...sue/web/modules/contrib/entity/src/Plugin/Derivative/EntityActionsDeriver.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 44 | WARNING | Unused variable $entity_type_id.
-----------------------------------------------------------------------------------


FILE: ...b/modules/contrib/entity/src/Plugin/Action/Derivative/DeleteActionDeriver.php
-----------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
  7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong
    |       |     one is Drupal\Core\Entity\EntityTypeInterface.
 15 | ERROR | [ ] The text '@deprecated ' does not match the standard format:
    |       |     @deprecated in %deprecation-version% and is removed from
    |       |     %removal-version%. %extra-info%.
 15 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following
    |       |     it
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...drupal-orgissue/web/modules/contrib/entity/src/Plugin/Action/DeleteAction.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 12 | ERROR | The text '@deprecated Use "entity:delete_action" instead.' does not
    |       | match the standard format: @deprecated in %deprecation-version% and
    |       | is removed from %removal-version%. %extra-info%.
 12 | ERROR | Each @deprecated tag must have a @see tag immediately following it
-----------------------------------------------------------------------------------


FILE: ...ite/drupal-orgissue/web/modules/contrib/entity/src/BundleEntityDuplicator.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 8 | ERROR | [x] Missing class doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...upal-orgissue/web/modules/contrib/entity/src/EntityPermissionProviderBase.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 13 | ERROR | Missing short description in doc comment
-----------------------------------------------------------------------------------


FILE: ...al-orgissue/web/modules/contrib/entity/src/EntityAccessControlHandlerBase.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 11 | ERROR | Missing short description in doc comment
-----------------------------------------------------------------------------------


FILE: ...ssue/web/modules/contrib/entity/src/Controller/RevisionOverviewController.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
 13 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong
    |       |     one is Drupal\Core\Entity\RevisionLogInterface.
 40 | ERROR | [ ] Parameter $renderer is not described in comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...rgissue/web/modules/contrib/entity/src/Controller/RevisionControllerTrait.php
-----------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------
  7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong
    |       |     one is Drupal\Core\Entity\EntityInterface.
 17 | ERROR | [ ] Description for the @return value is missing
 24 | ERROR | [ ] Description for the @return value is missing
 94 | ERROR | [ ] Description for the @return value is missing
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...issue/web/modules/contrib/entity/src/Controller/EntityDuplicateController.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 15 | ERROR | [x] Missing class doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...emo-site/drupal-orgissue/web/modules/contrib/entity/src/EntityViewBuilder.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 12 | ERROR | The text '@deprecated in favor of
    |       | \Drupal\Core\Entity\EntityViewBuilder. Use that instead.' does not
    |       | match the standard format: @deprecated in %deprecation-version% and
    |       | is removed from %removal-version%. %extra-info%.
 12 | ERROR | Each @deprecated tag must have a @see tag immediately following it
-----------------------------------------------------------------------------------


FILE: .../Demo-site/drupal-orgissue/web/modules/contrib/entity/src/EntityViewsData.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 153 | WARNING | Unused variable $type.
-----------------------------------------------------------------------------------


FILE: ...gissue/web/modules/contrib/entity/src/Routing/DeleteMultipleRouteProvider.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 13 | ERROR | The text '@deprecated Since Drupal 8.6.x the core
    |       | DefaultHtmlRouteProvider provides the route for any entity type with
    |       | a "delete-multiple-form" link template and a
    |       | "delete-multiple-confirm" form.' does not match the standard format:
    |       | @deprecated in %deprecation-version% and is removed from
    |       | %removal-version%. %extra-info%.
 13 | ERROR | Each @deprecated tag must have a @see tag immediately following it
-----------------------------------------------------------------------------------


FILE: .../web/modules/contrib/entity/src/EventSubscriber/EntityDuplicateSubscriber.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 10 | ERROR | [x] Missing class doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...drupal-orgissue/web/modules/contrib/entity/src/Event/EntityDuplicateEvent.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong
   |       |     one is Drupal\Component\EventDispatcher\Event.
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...rgissue/web/modules/contrib/entity/src/BundlePlugin/BundlePluginInstaller.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 11 | ERROR | [x] Missing class doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: ...-orgissue/web/modules/contrib/entity/src/BundlePlugin/BundlePluginHandler.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
  9 | ERROR | [x] Missing class doc comment
 56 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------

Time: 3.27 secs; Memory: 16MB

Kindly check

Thanks,
Jake

avpaderno’s picture

Notice that this issue is titled Update formatting for phpcs coding standards. It is not supposed to fix all the PHP_CodeSniffer errors/warnings.

The merge request is 7 commits behind and 3 commits ahead of the upstream repository, but there are conflicts with the upstream repository. It is better to start from scratch with another merge request.

avpaderno’s picture

Issue summary: View changes
avpaderno’s picture

Title: Update formatting for phpcs coding standards » Update formatting as per Drupal coding standards

avpaderno’s picture

Issue summary: View changes
Issue tags: +Needs reroll

capysara changed the visibility of the branch 3331201-drupal-coding-standards to hidden.

capysara’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Rerolled against latest version.

benstallings made their first commit to this issue’s fork.

klausi made their first commit to this issue’s fork.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Thank you! I reverted some changes that are not needed to README.txt and "?" nullable operators.

PHPCS is green and this should be ready to merge.

  • klausi committed ef603ac9 on 8.x-1.x authored by avpaderno
    style: #3331201 Update formatting as per Drupal coding standards (PHPCS)
    
klausi’s picture

Status: Reviewed & tested by the community » Fixed

Got commit access thanks to @Berdir.

Merged, thanks everyone!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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