Fix the errors/warnings reported by PHP_CodeSniffer

Created on 11 March 2024, 8 months ago
Updated 15 March 2024, 8 months ago

GitLab CI shows the following warnings/errors that should be fixed.

FILE: ...custom/timestamp_tz-3427074/src/Plugin/Field/FieldType/TimestampTzItem.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
   |       |     (Drupal.WhiteSpace.OpenTagNewline.BlankLine)
 1 | ERROR | [x] Expected 1 line before declare statement, found 0.
   |       |     (SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectWhitespaceBeforeDeclare)
 1 | ERROR | [x] Expected strict_types=1, found strict_types = 1.
   |       |     (SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectStrictTypesFormat)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...estamp_tz-3427074/src/Plugin/Field/FieldFormatter/TimestampTzFormatter.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------
 25 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
    |       |     (Drupal.Arrays.Array.ArrayIndentation)
 26 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
    |       |     (Drupal.Arrays.Array.ArrayIndentation)
 27 | ERROR | [x] Array closing indentation error, expected 4 spaces but found
    |       |     6 (Drupal.Arrays.Array.ArrayClosingIndentation)
 40 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    |       |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 41 | ERROR | [x] Expected 5 space(s) before asterisk; 3 found
    |       |     (Drupal.Commenting.DocCommentAlignment.SpaceBeforeStar)
 42 | ERROR | [x] Expected 5 space(s) before asterisk; 3 found
    |       |     (Drupal.Commenting.DocCommentAlignment.SpaceBeforeStar)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 196ms; Memory: 6MB

 
 

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024