Fix the issues reported by phpcs in the modules directory

Created on 22 December 2021, over 2 years ago
Updated 12 March 2024, 3 months ago

Problem/Motivation

Child issue from https://www.drupal.org/project/gutenberg/issues/3255691 ๐Ÿ“Œ [META] PHPCS errors on code Needs review
The idea here is to fix all phpcs errors/warnings from the files in the modules/ directory.

Steps to reproduce

Open the Gutenberg module directory on your terminal and run the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/ > phpcs_gutenber_modules.txt. You should end up with a file like the one attached bellow.

Proposed resolution

Fix the errors either automatically or manually and create a patch.

๐Ÿ“Œ Task
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡ง๐Ÿ‡ทBrazil andregp

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
     /**
    - * Class CloudBlock.
    + * Class CloudBlock stores data from Blocks.
      */

    A class short description must not start with Class followed by the class name.

     /**
    - * Class CloudBlockBase.
    + * Base class for Cloud Block.
      */
     class CloudBlockBase implements CloudBlockInterface {

    An article is missing before base class and cloud block.
    block should probably be blocks.

       /**
        * Block view css.
        *
        * @var null
        */
    -  protected $view_css = NULL;
    +  protected $viewCss = NULL;

    NULL is the default value, not the property type.

     /**
    - * Class CloudBlockManager.
    + * Class to Manage the CloudBlocks.
      */

    Class short descriptions do not start with Class.
    Only the first word in a sentence is spelled capitalized.
    CloudBlocks should be cloud blocks.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arpitk

    Hi Updated patch the patch with reference to #8. Please review.

    Thanks!

  • Status changed to Needs review about 1 year ago
  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Preethy_ray

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

Production build 0.69.0 2024