Fix the issues reported by phpcs

Created on 7 November 2022, almost 2 years ago
Updated 31 January 2023, over 1 year ago

Running phpcs --standard=Drupal --extensions=php,module,inc,install for the module shows the following report.

FILE: src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
  26 | ERROR | Missing member variable doc comment
  27 | ERROR | Missing member variable doc comment
 167 | ERROR | The array declaration extends to column 82 (the limit
     |       | is 80). The array content should be split up over
     |       | multiple lines
----------------------------------------------------------------------
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

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.

  • 🇮🇳India nayana_mvr

    Verified the patch #14 and tested it on Drupal version 10.1.x and PDF Reader 3.x. The patch works fine and errors mentioned in the tickets are fixed. I have added the screenshots for reference. But there is one warning

    FILE: .../pdf_reader/src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php
    ------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------
     180 | WARNING | [x] A comma should follow the last multiline array item. Found: )
    ------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 143ms; Memory: 10MB
  • Status changed to Fixed over 1 year ago
  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    Thanks everyone!

    Fixed on commit:

    diff --git a/src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php b/src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php
    index 682ed78..acb7d31 100644
    --- a/src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php
    +++ b/src/Plugin/Field/FieldFormatter/FieldPdfReaderField.php
    @@ -177,7 +177,7 @@ class FieldPdfReaderField extends FormatterBase {
         $toolbar = $this->getSetting('embed_hide_toolbar');
         $fragment = http_build_query([
           'view' => $fit,
    -      'toolbar' => ($toolbar ? 0 : 1)
    +      'toolbar' => ($toolbar ? 0 : 1),
         ]);
         foreach ($items as $delta => $item) {
           if ($values = $item->getValue('values')) {
    
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024