Fix the issues reported by phpcs

Created on 28 June 2023, over 1 year ago
Updated 7 June 2024, 6 months ago

Problem/Motivation

FILE: /home/system/Documents/contribution/color_pickr/color_pickr.module
---------------------------------------------------------------------------------------------
FOUND 82 ERRORS AND 1 WARNING AFFECTING 42 LINES
---------------------------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
 14 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 14 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 15 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 15 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 16 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 16 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 2
 17 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 17 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 2
 18 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 18 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 3
 19 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 19 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 2
 20 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 20 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 2
 22 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 22 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 3
 23 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 23 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 3
 24 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 24 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 3
 25 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 25 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 3
 26 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 26 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 3
 27 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 27 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 2
 29 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 29 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 2
 30 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 30 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 2
 31 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 31 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 2
 32 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 32 | ERROR   | [x] Case breaking statement indented incorrectly; expected 4 spaces, found 2
 33 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 33 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 40 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 40 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 40 | ERROR   | [x] Short array syntax must be used to define arrays
 41 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 41 | ERROR   | [x] Short array syntax must be used to define arrays
 42 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 42 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 42 | ERROR   | [x] Short array syntax must be used to define arrays
 43 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 43 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 44 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 45 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 45 | ERROR   | [x] Short array syntax must be used to define arrays
 46 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 46 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 46 | ERROR   | [x] Short array syntax must be used to define arrays
 47 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 47 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 48 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 49 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 49 | ERROR   | [x] Short array syntax must be used to define arrays
 50 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 50 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 50 | ERROR   | [x] Short array syntax must be used to define arrays
 51 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 51 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 52 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 53 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 53 | ERROR   | [x] Short array syntax must be used to define arrays
 54 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 54 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 54 | ERROR   | [x] Short array syntax must be used to define arrays
 55 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 55 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 56 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 57 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 57 | ERROR   | [x] Short array syntax must be used to define arrays
 58 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 58 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 58 | ERROR   | [x] Short array syntax must be used to define arrays
 59 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 59 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 60 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 60 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 61 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 62 | ERROR   | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 83 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 31 WARNINGS AFFECTING 31 LINES
----------------------------------------------------------------------
   9 | WARNING | Line exceeds 80 characters; contains 91 characters
  19 | WARNING | Line exceeds 80 characters; contains 128 characters
  23 | WARNING | Line exceeds 80 characters; contains 160 characters
  39 | WARNING | Line exceeds 80 characters; contains 107 characters
  45 | WARNING | Line exceeds 80 characters; contains 177 characters
  56 | WARNING | Line exceeds 80 characters; contains 87 characters
  64 | WARNING | Line exceeds 80 characters; contains 119 characters
  66 | WARNING | Line exceeds 80 characters; contains 186 characters
  70 | WARNING | Line exceeds 80 characters; contains 118 characters
  72 | WARNING | Line exceeds 80 characters; contains 188 characters
  93 | WARNING | Line exceeds 80 characters; contains 169 characters
 105 | WARNING | Line exceeds 80 characters; contains 82 characters
 116 | WARNING | Line exceeds 80 characters; contains 95 characters
 124 | WARNING | Line exceeds 80 characters; contains 212 characters
 132 | WARNING | Line exceeds 80 characters; contains 165 characters
 134 | WARNING | Line exceeds 80 characters; contains 133 characters
 149 | WARNING | Line exceeds 80 characters; contains 123 characters
 155 | WARNING | Line exceeds 80 characters; contains 129 characters
 172 | WARNING | Line exceeds 80 characters; contains 238 characters
 174 | WARNING | Line exceeds 80 characters; contains 215 characters
 180 | WARNING | Line exceeds 80 characters; contains 130 characters
 185 | WARNING | Line exceeds 80 characters; contains 96 characters
 196 | WARNING | Line exceeds 80 characters; contains 167 characters
 198 | WARNING | Line exceeds 80 characters; contains 139 characters
 212 | WARNING | Line exceeds 80 characters; contains 120 characters
 217 | WARNING | Line exceeds 80 characters; contains 170 characters
 234 | WARNING | Line exceeds 80 characters; contains 188 characters
 249 | WARNING | Line exceeds 80 characters; contains 90 characters
 256 | WARNING | Line exceeds 80 characters; contains 156 characters
 272 | WARNING | Line exceeds 80 characters; contains 358 characters
 276 | WARNING | Line exceeds 80 characters; contains 86 characters
----------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Utility/Html.php
-----------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 5 | ERROR | [x] Missing class doc comment
 5 | ERROR | [ ] Namespaced classes/interfaces/traits should be referenced with use statements
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldWidget/ColorPickrDefaultWidget.php
--------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AND 4 WARNINGS AFFECTING 17 LINES
--------------------------------------------------------------------------------------------------------------
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 31 | ERROR   | [x] Short array syntax must be used to define arrays
 42 | ERROR   | [x] Short array syntax must be used to define arrays
 46 | ERROR   | [x] Short array syntax must be used to define arrays
 49 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 60 | ERROR   | [x] Short array syntax must be used to define arrays
 61 | ERROR   | [x] Short array syntax must be used to define arrays
 74 | ERROR   | [x] Short array syntax must be used to define arrays
 77 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 80 | ERROR   | [x] Short array syntax must be used to define arrays
 83 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 85 | ERROR   | [x] Concat operator must be surrounded by a single space
 85 | ERROR   | [x] Concat operator must be surrounded by a single space
 86 | ERROR   | [x] Short array syntax must be used to define arrays
 87 | ERROR   | [x] Short array syntax must be used to define arrays
 87 | ERROR   | [x] Concat operator must be surrounded by a single space
 88 | WARNING | [x] A comma should follow the last multiline array item. Found: true
 88 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 89 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 93 | ERROR   | [x] Expected 1 newline at end of file; 0 found
 93 | ERROR   | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 21 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrCircleFormatter.php
-------------------------------------------------------------------------------------------------------------------
FOUND 18 ERRORS AFFECTING 11 LINES
-------------------------------------------------------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 30 | ERROR | [x] Short array syntax must be used to define arrays
 33 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 5
 33 | ERROR | [x] Expected 1 space after IF keyword; 0 found
 34 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 34 | ERROR | [x] Short array syntax must be used to define arrays
 38 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 38 | ERROR | [x] Short array syntax must be used to define arrays
 39 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 39 | ERROR | [x] Closing brace indented incorrectly; expected 5 spaces, found 4
 40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 40 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces, found 2
 42 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 45 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 0
 46 | ERROR | [x] Expected 1 newline at end of file; 0 found
 46 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrHexagonFormatter.php
--------------------------------------------------------------------------------------------------------------------
FOUND 18 ERRORS AFFECTING 11 LINES
--------------------------------------------------------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 30 | ERROR | [x] Short array syntax must be used to define arrays
 33 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 5
 33 | ERROR | [x] Expected 1 space after IF keyword; 0 found
 34 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 34 | ERROR | [x] Short array syntax must be used to define arrays
 38 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 38 | ERROR | [x] Short array syntax must be used to define arrays
 39 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 39 | ERROR | [x] Closing brace indented incorrectly; expected 5 spaces, found 4
 40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 40 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces, found 2
 42 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 45 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 0
 46 | ERROR | [x] Expected 1 newline at end of file; 0 found
 46 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrDefaultFormatter.php
--------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 10 LINES
--------------------------------------------------------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 30 | ERROR | [x] Short array syntax must be used to define arrays
 33 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 5
 33 | ERROR | [x] Expected 1 space after IF keyword; 0 found
 34 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 34 | ERROR | [x] Short array syntax must be used to define arrays
 38 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 38 | ERROR | [x] Short array syntax must be used to define arrays
 39 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 39 | ERROR | [x] Closing brace indented incorrectly; expected 5 spaces, found 4
 40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 40 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces, found 2
 42 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 43 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 43 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 0
 44 | ERROR | [x] Expected 1 newline at end of file; 0 found
 44 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrSquareFormatter.php
-------------------------------------------------------------------------------------------------------------------
FOUND 18 ERRORS AFFECTING 11 LINES
-------------------------------------------------------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 30 | ERROR | [x] Short array syntax must be used to define arrays
 33 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 5
 33 | ERROR | [x] Expected 1 space after IF keyword; 0 found
 34 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 34 | ERROR | [x] Short array syntax must be used to define arrays
 38 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 38 | ERROR | [x] Short array syntax must be used to define arrays
 39 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 39 | ERROR | [x] Closing brace indented incorrectly; expected 5 spaces, found 4
 40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 40 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces, found 2
 42 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 45 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 0
 46 | ERROR | [x] Expected 1 newline at end of file; 0 found
 46 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrLineFormatter.php
-----------------------------------------------------------------------------------------------------------------
FOUND 18 ERRORS AFFECTING 11 LINES
-----------------------------------------------------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 30 | ERROR | [x] Short array syntax must be used to define arrays
 33 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 5
 33 | ERROR | [x] Expected 1 space after IF keyword; 0 found
 34 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 34 | ERROR | [x] Short array syntax must be used to define arrays
 38 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 38 | ERROR | [x] Short array syntax must be used to define arrays
 39 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 39 | ERROR | [x] Closing brace indented incorrectly; expected 5 spaces, found 4
 40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 40 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces, found 2
 42 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 45 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 0
 46 | ERROR | [x] Expected 1 newline at end of file; 0 found
 46 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldType/ColorPickrItem.php
-----------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 31 | ERROR | [x] Short array syntax must be used to define arrays
 32 | ERROR | [x] Short array syntax must be used to define arrays
 33 | ERROR | [x] Short array syntax must be used to define arrays
 53 | ERROR | [ ] Visibility must be declared on property "$propertyDefinitions"
 60 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 60 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 4
 64 | ERROR | [x] Expected 1 newline at end of file; 0 found
 64 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldWidget/ColorPickrDefaultWidget.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 44 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 51 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 72 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrCircleFormatter.php
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 38 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrHexagonFormatter.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
 38 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrDefaultFormatter.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
 38 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrSquareFormatter.php
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 38 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/color_pickr/src/Plugin/Field/FieldFormatter/ColorPickrLineFormatter.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 38 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig modules/views_bulk_operations/

Proposed resolution

Resolve the PHPCS issues.

๐Ÿ“Œ Task
Status

Needs work

Version

1.1

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia urvashi_vora Madhya Pradesh, India

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

Merge Requests

Comments & Activities

  • Issue created by @urvashi_vora
  • Status changed to Needs work over 1 year ago
  • Hii, @urvashi_vora, Review your patch.

    These are the steps I followed:

    1. Took clone in drupal 10.1.x

    2. Applied patch and ran this command:

    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig modules/contrib/color_pickr/

    3. Applied your patch and again ran phpcs command.

    found errors.

    Needs work.

  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    Initial patch doesn't applies on 1.x branch.

    Remaining issue:

    FILE: /home/system/Documents/contribution/color_picker/src/Element/ColorPicker.php
    ----------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------
     16 | ERROR | Long array syntax must not be used in doc comment code annotations
    ----------------------------------------------------------------------------------
    
    Time: 35ms; Memory: 8MB
    

    Providing updated patch.

  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aayushDrupal

    hi nitin_lama,
    Patch #4 was not applied successfully and is displaying an error.

     git apply -v coding_standard_fix_4.patch
    Checking patch color_picker.module...
    error: color_picker.module: No such file or directory
    

    Please check.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sakthi_dev

    Hi @nitin _lama, aayushmankotia the patch provided is for color_picker and the issue is raised for color_pickr. Please verify.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia SandeepSingh199

    Hi try with this patch

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia SandeepSingh199

    Hi try with this patch

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    A summary must describe what needs to be changed, and eventually why. A screenshot is not sufficient, even in the case a patch/MR is provided.
    In the case of bug reports, the steps to reproduce the bug should be provided too. In the case of coding standards issues found using an automatic tool, the report given by that tool must be quoted too, including the arguments passed to that tool, if it is a command line tool.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia pray_12

    Fixed the issues reported by phpcs

  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    Thanks. Patch #12 fixes issues reported by phpcs.

    Applied patch and ran these commands:

    • phpcs --standard=DrupalPractice --extensions='php,module,inc,install,test,profile,theme,info,txt,md'
    • phpcs --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,info,txt,md'
  • Merge request !2#3370897: phpcs fixes. โ†’ (Open) created by nitin_lama
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    Please review the MR.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Yashaswi18

    To verify I ran the command :

    phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml c
    olor_pickr/

    There are no errors remaining.

  • ๐Ÿ‡ณ๐Ÿ‡ตNepal sujan shrestha Nepal๐Ÿ‡ณ๐Ÿ‡ต, Kathmandu

    I have fixed the PHPCS issue on the 1.1.x branch and ran the command to verify that the issues have been resolved.

    phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml c
    olor_pickr/
  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines cleavinjosh

    Hi @nitin_lama,

    I applied MR!2 on 1.1.x-dev and I encountered some errors.

    โžœ  color_pickr git:(1.1.x) curl https://git.drupalcode.org/project/color_pickr/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 38545    0 38545    0     0  87375      0 --:--:-- --:--:-- --:--:-- 87403
    patching file README.md
    Hunk #1 FAILED at 6.
    Hunk #2 FAILED at 17.
    Hunk #3 FAILED at 40.
    Hunk #4 FAILED at 61.
    Hunk #5 FAILED at 70.
    Hunk #6 FAILED at 105.
    Hunk #7 FAILED at 119.
    Hunk #8 FAILED at 131.
    Hunk #9 FAILED at 140.
    Hunk #10 FAILED at 150.
    Hunk #11 FAILED at 170.
    Hunk #12 FAILED at 195.
    Hunk #13 FAILED at 248.
    Hunk #14 FAILED at 273.
    Hunk #15 FAILED at 319.
    15 out of 15 hunks FAILED -- saving rejects to file README.md.rej

    Please check and advise.
    Thank you.

Production build 0.71.5 2024