Fix the issues reported by phpcs

Created on 5 July 2019, almost 5 years ago
Updated 28 February 2024, 4 months ago

Hey, I came across some best practices issues and coding standards, example of Drupal practices :

phpcs --standard=Drupal modules/contrib/advagg/

FILE: /var/www/drupal-8/modules/contrib/advagg/tests/modules/advagg_test/css/test.css
-------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------
 6 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/tests/src/Kernel/Asset/css_test_files/url_test_parent_dir.css
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------
 2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/tests/src/Kernel/Asset/css_test_files/url_test_same_dir.css
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
 2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/tests/src/Kernel/Asset/css_test_files/url_test_child_dir.css
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/src/Asset/AssetOptimizer.php
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 293 | ERROR | Protected method name "AssetOptimizer::shouldGZip" is not in lowerCamel format
----------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_bundler/tests/modules/advagg_bundler_test/test.css
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_bundler/src/Asset/AdvaggCssCollectionGrouper.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------
 80 | ERROR | If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_js_minify/src/Asset/JsMinifier.php
----------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------
 177 | ERROR | Parameter $path is not described in comment
 233 | ERROR | Parameter $path is not described in comment
 270 | ERROR | Parameter $path is not described in comment
----------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/comment_hacks.css.optimized.css
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 62 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  1 | ERROR | [x] Opening brace should be the last content on the line
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  1 | ERROR | [ ] Style definitions must end with a semicolon
  1 | ERROR | [x] Closing brace of class definition must be on new line
  1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  1 | ERROR | [x] Opening brace should be the last content on the line
  1 | ERROR | [x] Each style definition must be on a line by itself
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  1 | ERROR | [ ] Style definitions must end with a semicolon
  1 | ERROR | [x] Closing brace of class definition must be on new line
  1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  1 | ERROR | [x] Opening brace should be the last content on the line
  1 | ERROR | [x] Each style definition must be on a line by itself
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  1 | ERROR | [x] Each style definition must be on a line by itself
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  1 | ERROR | [ ] Style definitions must end with a semicolon
  1 | ERROR | [x] Closing brace of class definition must be on new line
  1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  1 | ERROR | [x] Opening brace should be the last content on the line
  1 | ERROR | [x] Each style definition must be on a line by itself
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  1 | ERROR | [ ] Style definitions must end with a semicolon
  1 | ERROR | [x] Closing brace of class definition must be on new line
  1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  1 | ERROR | [x] Opening brace should be the last content on the line
  1 | ERROR | [x] Each style definition must be on a line by itself
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  1 | ERROR | [ ] Style definitions must end with a semicolon
  1 | ERROR | [x] Closing brace of class definition must be on new line
  1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  1 | ERROR | [x] Opening brace should be the last content on the line
  1 | ERROR | [x] Each style definition must be on a line by itself
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  1 | ERROR | [ ] Style definitions must end with a semicolon
  1 | ERROR | [x] Closing brace of class definition must be on new line
  1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  1 | ERROR | [x] Opening brace should be the last content on the line
  1 | ERROR | [x] Each style definition must be on a line by itself
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  1 | ERROR | [ ] Style definitions must end with a semicolon
  1 | ERROR | [x] Closing brace of class definition must be on new line
  1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  1 | ERROR | [x] Opening brace should be the last content on the line
  1 | ERROR | [x] Each style definition must be on a line by itself
  1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  8 | ERROR | [ ] Style definitions must end with a semicolon
  8 | ERROR | [x] Closing brace of class definition must be on new line
  8 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  8 | ERROR | [x] Opening brace should be the last content on the line
  8 | ERROR | [x] Each style definition must be on a line by itself
  8 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 15 | ERROR | [ ] Style definitions must end with a semicolon
 15 | ERROR | [x] Closing brace of class definition must be on new line
 15 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 15 | ERROR | [x] Opening brace should be the last content on the line
 15 | ERROR | [x] Each style definition must be on a line by itself
 15 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 33 | ERROR | [ ] Style definitions must end with a semicolon
 33 | ERROR | [x] Expected 1 newline at end of file; 0 found
 33 | ERROR | [x] Closing brace of class definition must be on new line
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 52 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_without_import.css
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 11 LINES
-----------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] Additional whitespace found at start of file
 24 | ERROR | [x] Selectors must be on a single line
 25 | ERROR | [x] Selectors must be on a single line
 26 | ERROR | [x] Selectors must be on a single line
 28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 38 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 39 | ERROR | [x] Blank lines are not allowed in class definitions
 61 | ERROR | [x] Multiple selectors should each be on a single line
 64 | ERROR | [x] Expected 1 newline at end of file; 2 found
 65 | ERROR | [x] Additional whitespace found at end of file
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_with_charset.css
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] Selectors must be on a single line
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/charset_sameline.css
---------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 1 | ERROR | [x] Opening brace should be the last content on the line
 1 | ERROR | [x] Closing brace of class definition must be on new line
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/quotes.css
-----------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------------------
  9 | ERROR | [x] Blank lines are not allowed between class names
 10 | ERROR | [x] Opening brace should be the last content on the line
 10 | ERROR | [ ] Style definitions must end with a semicolon
 10 | ERROR | [x] Closing brace of class definition must be on new line
 14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 30 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_without_import.css.optimized.css
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------
 1 | WARNING | File appears to be minified and cannot be processed
-------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_with_utf16_bom.css
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
 2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 2 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/quotes.css.optimized.css
-------------------------------------------------------------------------------------------------------------------------------
FOUND 37 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------
 8 | ERROR | [x] Blank lines are not allowed between class names
 9 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 9 | ERROR | [x] Opening brace should be the last content on the line
 9 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 9 | ERROR | [ ] Style definitions must end with a semicolon
 9 | ERROR | [x] Closing brace of class definition must be on new line
 9 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 9 | ERROR | [x] Opening brace should be the last content on the line
 9 | ERROR | [x] Each style definition must be on a line by itself
 9 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 9 | ERROR | [ ] Style definitions must end with a semicolon
 9 | ERROR | [x] Closing brace of class definition must be on new line
 9 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 9 | ERROR | [x] Opening brace should be the last content on the line
 9 | ERROR | [x] Each style definition must be on a line by itself
 9 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 9 | ERROR | [ ] Style definitions must end with a semicolon
 9 | ERROR | [x] Closing brace of class definition must be on new line
 9 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 9 | ERROR | [x] Opening brace should be the last content on the line
 9 | ERROR | [x] Each style definition must be on a line by itself
 9 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 9 | ERROR | [ ] Style definitions must end with a semicolon
 9 | ERROR | [x] Closing brace of class definition must be on new line
 9 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 9 | ERROR | [x] Opening brace should be the last content on the line
 9 | ERROR | [x] Each style definition must be on a line by itself
 9 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 9 | ERROR | [ ] Style definitions must end with a semicolon
 9 | ERROR | [x] Closing brace of class definition must be on new line
 9 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 9 | ERROR | [x] Opening brace should be the last content on the line
 9 | ERROR | [x] Each style definition must be on a line by itself
 9 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 9 | ERROR | [ ] Style definitions must end with a semicolon
 9 | ERROR | [x] Expected 1 newline at end of file; 0 found
 9 | ERROR | [x] Closing brace of class definition must be on new line
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 31 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_with_bom_and_charset.css
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] Selectors must be on a single line
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/charset_newline.css
--------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] Selectors must be on a single line
 2 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 2 | ERROR | [x] Opening brace should be the last content on the line
 2 | ERROR | [x] Closing brace of class definition must be on new line
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/charset.css.optimized.css
--------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 1 | ERROR | [x] Opening brace should be the last content on the line
 1 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 1 | ERROR | [ ] Style definitions must end with a semicolon
 1 | ERROR | [x] Expected 1 newline at end of file; 0 found
 1 | ERROR | [x] Closing brace of class definition must be on new line
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/comment_hacks.css
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 1 | WARNING | File appears to be minified and cannot be processed
------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/drupal-8/modules/contrib/advagg/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 125 | WARNING | Line exceeds 80 characters; contains 81 characters
----------------------------------------------------------------------

Time: 2.43 secs; Memory: 12MB
📌 Task
Status

Needs work

Version

4.0

Component

Code

Created by

🇲🇩Moldova Sergiu Stici

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, 🇮🇹
    -          $group_keys = $item['preprocess'] ? [$item['type'], $item['group'], $item['media'], $item['browsers']] : FALSE;
    +          $group_keys = $item['preprocess'] ? [$item['type'], $item['group'], $item['media'],
    +            $item['browsers'],
    +          ] : FALSE;

    Lines are allowed to be longer than 80 characters, if the code is more readable.

    -.test1 { display:block;}
    +A large comment block to test for segfaults and speed. This is 60K a's. Extreme but useful to demonstrate flaws in comment striping regexp. */

    Where are the 60,000 As? That comment contains 60,000 As for a reason, and that reason is even explained from that comment: Extreme but useful to demonstrate flaws in comment striping regexp. That comment cannot be changed.

    @@ -21,12 +20,9 @@ body {
      * CSS spec says that all whitespace is valid whitespace, so this selector
      * should be just as good as the one above.
      */
    -.this
    -.is
    -.a
    -.test {
    -font: 1em/100% Verdana, sans-serif;
    -color: #494949;
    +.this .is .a .test {
    +  font: 1em/100% Verdana, sans-serif;
    +  color: #494949;

    That is a test file. It is used to test something and it cannot be changed.

    diff --git a/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_without_import.css.optimized.css b/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_without_import.css.optimized.css
    index ebe82fb..bdc01fd 100755
    --- a/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_without_import.css.optimized.css
    +++ b/advagg_css_minify/tests/src/Kernel/Asset/css_test_files/css_input_without_import.css.optimized.css
    @@ -1 +1,43 @@
    -body{margin:0;padding:0;background:#edf5fa;font:76%/170% Verdana,sans-serif;color:#494949}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949}some :pseudo .thing{border-radius:3px}::-moz-selection{background:#000;color:#fff}::selection{background:#000;color:#fff}@media print{*{background:#000 !important;color:#fff !important}@page{margin:.5cm}}@media screen and (max-device-width:480px){background:#000;color:#fff}textarea,select{font:1em/160% Verdana,sans-serif;color:#494949}
    \ No newline at end of file
    +body {
    +  margin: 0;
    +  padding: 0;
    +  background: #edf5fa;
    +  font: 76%/170% Verdana,sans-serif;
    +  color: #494949;
    +}
    +.this .is .a .test {
    +  font: 1em/100% Verdana,sans-serif;
    +  color: #494949;
    +}
    +.this .is .a .test {
    +  font: 1em/100% Verdana,sans-serif;
    +  color: #494949;
    +}
    +some :pseudo .thing {
    +  border-radius: 3px;
    +}
    +::-moz-selection {
    +  background: #000;
    +  color: #fff;
    +}
    +::selection {
    +  background: #000;
    +  color: #fff;
    +}
    +@media print {
    +  * {
    +    background: #000 !important;
    +    color: #fff !important;
    +  }
    +  @page {
    +    margin: .5cm;
    +  }
    +}
    +@media screen and (max-device-width:480px) {
    +  background: #000;
    +  color: #fff;
    +}
    +textarea select {
    +  font: 1em/160% Verdana,sans-serif;
    +  color: #494949;
    +}

    The css_test_files directory probably contain test files that need to be preserved as they are.

  • 🇮🇳India Shank115

    I applied patch in #22 and it applied cleanly

  • Status changed to Needs review 4 months ago
  • Status changed to Needs work 4 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    -     headers for all optimized files. Only supported on Edge 15+ and Firefox 49+.
    +     headers for all optimized files.
    +     Only supported on Edge 15+ and Firefox 49+.

    Making a line shorter than 81 characters does not mean starting a new sentence on a new line.

    -        // Only delete files older than stale file threshold defined under Cron Options.
    +        // Only delete files older than stale
    +        // file threshold defined under Cron Options.

    Lines should as closer as possible to 80 characters, without splitting words on two lines. That does not mean moving six words on a new line.

    -      '#options' => ['google' => 'Google', 'microsoft' => 'Microsoft'],
    +      '#options' => [$this->t('google' => 'Google'),
    +        $this->t('microsoft' => 'Microsoft'),
    +      ],

    The changed code contains syntax errors.

    -    $contents = preg_replace_callback('/@import\s*(?:url\(\s*)?[\'"]?(?![a-z]+:)(?!\/\/)([^\'"\()]+)[\'"]?\s*\)?\s*;/', [$this, 'loadNestedFile'], $contents);
    +    $contents = preg_replace_callback('/@import\s*(?:url\(\s*)?[\'"]?(?![a-z]+:)(?!\/\/)([^\'"\()]+)[\'"]?\s*\)?\s*;/',
    +    [$this, 'loadNestedFile'], $contents);
     

    Code lines are allowed to exceed 80 characters if they are easier to understand. The changed code is not correctly formatted.

    -@charset "UTF-8";
    -html{font-family:"sans-serif";}
    +@charset "UTF-8"; html {
    +  font-family: "sans-serif";
    +}

    The @charset "UTF-8"; line is probably not related to the following CSS style to be placed on the same line.

    -    $response->setContent(preg_replace_callback($pattern, [$this, 'forceAbsolutePathsCallback'], $content));
    +    $response->setContent(preg_replace_callback($pattern,
    +    [
    +      $this,
    +      'forceAbsolutePathsCallback',
    +    ],
    +    $content));
     

    The new code is not correctly formatted.

         $cookie_name = 'AdvAggDisabled';
         $key = Crypt::hashBase64($this->privateKey->get());
    +    $stack = $stack->getCurrentRequest();

    $stack has not been initialized; it is not possible to call $stack->getCurrentRequest()

Production build 0.69.0 2024