CommentFileSizeAuthor
#2 3339496-2.patch19.92 KBsahil.goyal

Issue fork cer-3339496

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: Needs work » Needs review
Issue tags: +Phpcs Drupal coding standard issue
StatusFileSize
new19.92 KB

Fixing all the php coding standard issues and warnings in this patch. Please Review.

charchil khandelwal’s picture

Assigned: Unassigned » charchil khandelwal

I will review this.

charchil khandelwal’s picture

Assigned: charchil khandelwal » Unassigned

Patch #2 tested and applied successfully, all errors and warnings are fixed now.
Created MR !9 for this issue.
Please review.

Thanks.

avpaderno’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix the issues reported by phpcs
Version: 5.0.0-beta2 » 5.x-dev
Category: Bug report » Task
Priority: Normal » Minor
Issue tags: - +Coding standards
avpaderno’s picture

Status: Needs review » Needs work
 /**
  * @file
- * Describes hooks and plugins provided by the Corresponding entities references module.
+ * Corresponding entities module offers hooks & plugins for references.
  */

The correct short description for those files is Describes hooks provided by the [module name] module.

- *   Differences arrary calculated by CorrespondingReference::calculateDifferences()
+ *   Diff. arrary calculated by CorrespondingReference::calculateDifferences()

The existing description is correct, except for a typo.

function hook_cer_differences_alter(\Drupal\Core\Entity\ContentEntityInterface $entity,
-  array &$differences, $correspondingField) {
+  array &$differences,
+ $correspondingField) {

As per Drupal coding standards, function declarations are written in a single line.

+  /**
+   * Builds the header row for the entity listing.
+   */
   public function buildHeader() {

The return value is not documented.

+  /**
+   * Builds the row for the entity listing.
+   */
   public function buildRow(EntityInterface $entity) {

Parameters and return value descriptions are missing.

bindu r made their first commit to this issue’s fork.

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

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

sakthi_dev’s picture

Status: Needs work » Needs review

Addressed the comment #7. Please review.

a.aaronjake’s picture

Status: Needs review » Needs work

Hi @sakthi_dev,

Your changes on the MR !9 was applied not-so successfully and errors were reported. Please see below:

 cer git:(5.x) curl https://git.drupalcode.org/project/cer/-/merge_requests/9.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21604    0 21604    0     0  45057      0 --:--:-- --:--:-- --:--:-- 46560
patching file README.md
patching file cer.api.php
patching file cer.module
patching file src/CorrespondingReferenceListBuilder.php
patching file src/CorrespondingReferenceOperations.php
patching file src/CorrespondingReferenceStorage.php
patching file src/CorrespondingReferenceStorageInterface.php
patching file src/Entity/CorrespondingReference.php
patching file src/Entity/CorrespondingReferenceInterface.php
patching file src/EventSubscriber/CerSubscriber.php
patching file src/Form/CorrespondingReferenceDeleteForm.php
patching file src/Form/CorrespondingReferenceForm.php
Hunk #7 succeeded at 186 (offset 1 line).
Hunk #8 succeeded at 206 (offset 1 line).
Hunk #9 succeeded at 245 (offset 1 line).
Hunk #10 succeeded at 268 (offset 1 line).
Hunk #11 succeeded at 279 (offset 1 line).
Hunk #12 succeeded at 306 (offset 1 line).
Hunk #13 succeeded at 315 (offset 1 line).
patching file src/Form/CorrespondingReferenceSyncForm.php
➜  cer git:(5.x) ✗ cd ..
➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig cer

FILE: ...etInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/cer/cer.api.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 14 | WARNING | Line exceeds 80 characters; contains 83 characters
--------------------------------------------------------------------------------


FILE: ...-orgissue-v9/web/modules/contrib/cer/src/Entity/CorrespondingReference.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is Drupal\cer\CorrespondingReferenceOperations.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...issue-v9/web/modules/contrib/cer/src/CorrespondingReferenceListBuilder.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is
   |       |     Drupal\cer\Entity\CorrespondingReferenceInterface.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 545ms; Memory: 12MB

Kindly check

Thanks,
Jake

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

apaderno changed the visibility of the branch 3339496-drupal-coding-standards to hidden.

avpaderno’s picture

Issue summary: View changes
avpaderno’s picture

Status: Needs work » Reviewed & tested by the community

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

grevil’s picture

PHPCS doesn't complain any more. Thanks all!

Merging.

grevil’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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