[4.0.x] Word Serialization

Created on 9 June 2023, over 1 year ago
Updated 1 July 2024, 6 months ago

The Word Serialization module uses the serialization API to be able to create DOCX documents based on views. There is a text replacement element to the module, where ${search-pattern} would be replaced by the field that is named search-pattern.

At time of writing there is no similar module that would do the same. We also maintain the xls_serialization module, which does a similar thing, but for excel-exports. The same set of libraries are used for both (PHP Office).

Project link

https://www.drupal.org/project/doc_serialization โ†’

๐Ÿ“Œ Task
Status

Closed: won't fix

Component

module

Created by

๐Ÿ‡ณ๐Ÿ‡ฑNetherlands theemstra

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

Comments & Activities

  • Issue created by @theemstra
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shashank5563 New Delhi

    Thank you for applying! Reviewers will review the project files, describing what needs to be changed.

    Please read Review process for security advisory coverage: What to expect โ†’ for more details and Security advisory coverage application checklist โ†’ to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

    To reviewers: Please read How to review security advisory coverage applications โ†’ , What to cover in an application review โ†’ , and Drupal.org security advisory coverage application workflow โ†’ .

    While this application is open, only the user who opened the application can make commits to the project used for the application.

    Reviewers only describe what needs to be changed; they don't provide patches to fix what reported in a review.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shashank5563 New Delhi
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shashank5563 New Delhi
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shashank5563 New Delhi

    Fix PHPcs Issue.

    vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,php  web/modules/doc_serialization/
    
    FILE: /modules/doc_serialization/doc_serialization.install
    --------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AFFECTING 5 LINES
    --------------------------------------------------------------------------------------------
      1 | ERROR | [x] Missing file doc comment
      1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
      9 | ERROR | [x] Short array syntax must be used to define arrays
     13 | ERROR | [x] Expected 1 blank line after function; 0 found
     20 | ERROR | [x] Short array syntax must be used to define arrays
     22 | ERROR | [x] Expected 1 space before "!=="; 0 found
    --------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/tests/src/Unit/EventSubscriber/SubscriberTest.php
    --------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------------------------
      1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
     24 | ERROR | [x] Expected 1 blank line before function; 0 found
    --------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/README.md
    ----------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------------
      8 | WARNING | Line exceeds 80 characters; contains 288 characters
      9 | WARNING | Line exceeds 80 characters; contains 83 characters
     15 | WARNING | Line exceeds 80 characters; contains 104 characters
     43 | WARNING | Line exceeds 80 characters; contains 94 characters
    ----------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/src/Encoder/Docx.php
    -----------------------------------------------------------------------------------------------------
    FOUND 28 ERRORS AND 11 WARNINGS AFFECTING 39 LINES
    -----------------------------------------------------------------------------------------------------
       1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
       5 | WARNING | [x] Unused use statement
       6 | WARNING | [x] Unused use statement
       7 | WARNING | [x] Unused use statement
       8 | WARNING | [x] Unused use statement
       9 | WARNING | [x] Unused use statement
      10 | WARNING | [x] Unused use statement
      13 | WARNING | [x] Unused use statement
      17 | ERROR   | [x] Expected 1 space(s) before asterisk; 0 found
      18 | ERROR   | [x] Expected 1 space(s) before asterisk; 0 found
      22 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      23 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      24 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      25 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      29 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      30 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      31 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      32 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      36 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      37 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      38 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      39 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      40 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      46 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      47 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      48 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      49 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
      53 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 6
      54 | ERROR   | [x] Case breaking statement indented incorrectly; expected 8 spaces, found 6
      57 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 6
      58 | ERROR   | [x] Case breaking statement indented incorrectly; expected 8 spaces, found 6
      61 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 6
      62 | ERROR   | [x] Case breaking statement indented incorrectly; expected 8 spaces, found 6
      75 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
      76 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
      86 | WARNING | [ ] Unused variable $key.
     103 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     109 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
     110 | ERROR   | [x] Expected 3 space(s) before asterisk; 2 found
    -----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 35 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/src/Encoder/Doc.php
    ----------------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    ----------------------------------------------------------------------------------------------------------------------------
      1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
     59 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     60 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
    ----------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/src/Plugin/views/display/WordExport.php
    ----------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ----------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/src/Plugin/views/display_extender/DocSerialization.php
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 61 ERRORS AND 5 WARNINGS AFFECTING 53 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------
       1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
       1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
       2 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
      10 | ERROR   | [x] There must be one blank line after the last USE statement; 0 found;
      27 | ERROR   | [x] Expected 1 blank line before function; 0 found
      28 | ERROR   | [x] Expected 1 space after "="; 2 found
      28 | ERROR   | [x] Short array syntax must be used to define arrays
      29 | ERROR   | [x] Short array syntax must be used to define arrays
      30 | ERROR   | [x] Short array syntax must be used to define arrays
      31 | ERROR   | [x] Short array syntax must be used to define arrays
      32 | WARNING | [x] A comma should follow the last multiline array item. Found: )
      34 | ERROR   | [x] Expected 1 blank line after function; 0 found
      39 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
      39 | ERROR   | [x] Perl-style comments are not allowed; use "// Comment" instead
      40 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
      40 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
      41 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
      42 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
      42 | ERROR   | [x] Short array syntax must be used to define arrays
      43 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      46 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
      47 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
      47 | WARNING | [ ] Only string literals should be passed to t() where possible
      48 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
      49 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 6
      50 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 6
      51 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
      52 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
      53 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 6
      54 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
      55 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
      55 | ERROR   | [x] Short array syntax must be used to define arrays
      57 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      58 | ERROR   | [x] Expected 1 space after "=>"; 2 found
      60 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
      61 | ERROR   | [x] Expected 1 blank line after function; 0 found
      67 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      83 | ERROR   | [x] Short array syntax must be used to define arrays
      96 | ERROR   | [x] Expected 1 blank line after function; 0 found
     101 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     102 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     103 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     104 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     105 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     106 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     107 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     108 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 12
     109 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     110 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     111 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     112 | ERROR   | [x] Expected 1 blank line after function; 0 found
     127 | ERROR   | [x] Expected 1 blank line after function; 0 found
     131 | ERROR   | [x] There should be no white space after an opening "{"
     131 | ERROR   | [x] There should be no white space before a closing "}"
     131 | ERROR   | [x] Expected 1 blank line after function; 0 found
     135 | ERROR   | [x] There should be no white space after an opening "{"
     135 | ERROR   | [x] There should be no white space before a closing "}"
     135 | ERROR   | [x] Expected 1 blank line after function; 0 found
     138 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
     140 | ERROR   | [x] There should be no white space after an opening "{"
     140 | ERROR   | [x] There should be no white space before a closing "}"
     140 | ERROR   | [x] Expected 1 blank line after function; 0 found
     147 | ERROR   | [x] Expected 1 blank line after function; 0 found
     155 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     157 | ERROR   | [x] Expected 1 blank line after function; 0 found
     158 | ERROR   | [x] The closing brace for the class must have an empty line before it
    ----------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 61 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/src/Plugin/views/style/WordExport.php
    --------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    --------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/src/EventSubscriber/Subscriber.php
    -----------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    -----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------
    
    
    FILE: /modules/doc_serialization/doc_serialization.info.yml
    ---------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
    ---------------------------------------------------------------------------------------------------------------
     1 | WARNING | [ ] Remove "version" from the info file, it will be added by drupal.org packaging automatically
     7 | WARNING | [ ] All dependencies must be prefixed with the project name, for example "drupal:"
     8 | WARNING | [ ] All dependencies must be prefixed with the project name, for example "drupal:"
     9 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    ---------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands theemstra

    Thanks, I was able to resolve all the warnings and errors as provided by PHPCS.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    • The following points are just a start and don't necessarily encompass all of the changes that may be necessary
    • A specific point may just be an example and may apply in other places
    • A review is about code that doesn't follow the coding standards, contains possible security issue, or doesn't correctly use the Drupal API; the single points aren't ordered, not even by importance

    Projects hosted on drupal.org are licensed under GPLv2+, the same license used from Drupal core. If you are licensing a project under a different license, it cannot he hosted on drupal.org. More details are given in Drupal Git Contributor Agreement & Repository Usage Policy โ†’ .

    All code that is a derivative work of Drupal (typically PHP code, including but not limited to: core patches, modules, themes, etc) committed to Drupal.org's git repository is licensed as GPL version 2.0 and later (official short identifier: โ€œGPL-2.0-or-laterโ€). This means that the code is licensed under GPLv2, and there exists an option that allows downstream recipients to re-license the code to be under a later version of GPL.

    For code licensed under GPLv3, see See I want to release my work under GPL version 3 or under GPL version 2-only. Can I do so and host it on Drupal.org? โ†’

    I want to release my work under GPL version 3 or under GPL version 2-only. Can I do so and host it on Drupal.org?

    No. You can release your work under any GPL version 2 or later compatible license, however, you may only check it into Drupal's Git repositories if you are releasing it under the same license as Drupal itself, that is, GPL version 2 or later, allowing users to choose between the terms of the GPL version 2 or the terms in any new versions as updated by the FSF. If you are unable or unwilling to do so, do not check it into a Drupal Git repository.

    src/Encoder/Doc.php

          // @todo utilize a temporary file perhaps?
          // @todo This should also support batch processing.
          ob_start();
    

    What follows @todo is a sentence: It starts with a capitalized letter and it ends with a period (preferably), a question mark, or an exclamation point.

      /**
       * Set document data.
       *
       * @param \PhpOffice\PhpWord\PhpWord $word
    

    The verb used in the description must be declined to the third person singular.

    /* Note: any element you append to a document must reside inside of a Section. */

    Inside functions and methods, comments use // as delimiter, except in comments like /** @var \Drupal\views\ViewExecutable $view */.

        catch (\Exception $e) {
          \Drupal::logger('docx')->error($e->getMessage());
        }
    

    The $message parameter passed to the LoggerInterface methods must be a literal string.
    For exceptions, the function used to log them should be watchdog_exception(); alternatively, code similar to that should be used.
    \Drupal should not be used for the services a class uses.

    doc_serialization.services.yml

    services:
      doc_serialization.encoder.docx:
        class: Drupal\doc_serialization\Encoder\Docx
        tags:
          - { name: encoder, format: docx }
      doc_serialization.subscriber:
        class: Drupal\doc_serialization\EventSubscriber\Subscriber
        tags:
          - { name: event_subscriber }
    

    An encoder is exposed as service, but the module implements two encoders.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    dependencies:
      - serialization
      - rest
    

    Dependencies on the .info.yml file are still not using namespaces.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands theemstra

    Thanks for the extensive feedback so far.

    Fixed #7 -> The watchdog_exception deprecated in D10 and will be removed in D11, so implemented the recommended exception logger
    Fixed #8

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

    The LICENSE file is still for GPLv3, which cannot be used for a module hosted on drupal.org.
    There are two encoder classes, but only one is referenced in the .services.yml file, which means Drupal will see just an encoder.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands theemstra

    Hi,

    The LICENSE file has been replaced, the second encoder declaration was added in a previous commit earlier last week.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinaymahale

    Rechecked and found the below PHPCS issues. Please fix

    FILE: /doc_serialization/src/Plugin/views/display_extender/DocSerialization.php
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------
      43 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      57 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      68 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     162 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
    ----------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /doc_serialization/src/Encoder/Docx.php
    ----------------------------------------------------------------------------------------------------
    FOUND 7 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
    ----------------------------------------------------------------------------------------------------
      8 | ERROR   | [x] When importing a class with "use", do not include a leading \
     69 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
     70 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     80 | WARNING | [ ] Unused variable $key.
     90 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     90 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     97 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
     97 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 1
     97 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     98 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
     98 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 1
    ----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------
    
    
    FILE: /doc_serialization/src/Encoder/Doc.php
    ---------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    ---------------------------------------------------------------------------------
     66 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
     66 | WARNING | [x] There must be no blank line following an inline comment
     66 | WARNING | [ ] There must be no blank line following an inline comment
    ---------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands theemstra

    The issues mentioned in #13 should already have been resolved in the latest commits done after previous posts.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    Fix phpcs issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml doc_serialization/
    
    FILE: doc_serialization/src/Plugin/views/display_extender/DocSerialization.php
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
    --------------------------------------------------------------------------------
       6 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
      43 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      57 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      68 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     162 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: doc_serialization/src/Encoder/Doc.php
    ----------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    ----------------------------------------------------------------------------
     66 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
     66 | WARNING | [x] There must be no blank line following an inline comment
     66 | WARNING | [ ] There must be no blank line following an inline comment
    ----------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------
    
    
    FILE: doc_serialization/src/Encoder/Docx.php
    --------------------------------------------------------------------------------
    FOUND 8 ERRORS AND 4 WARNINGS AFFECTING 8 LINES
    --------------------------------------------------------------------------------
      7 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\file\Entity\File.
      8 | ERROR   | [x] When importing a class with "use", do not include a leading \
     69 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
     70 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     80 | WARNING | [ ] Unused variable $key.
     90 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     90 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     97 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
     97 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 1
     97 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     98 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
     98 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 1
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: doc_serialization/src/EventSubscriber/Subscriber.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\EventDispatcher\EventSubscriberInterface.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: doc_serialization/tests/src/Unit/EventSubscriber/SubscriberTest.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Tests\UnitTestCase.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    I am changing priority as per Issue priorities โ†’ .

  • Status changed to Closed: won't fix 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rushiraval

    This thread has been idle, in the needs work state with no activity for several months. Therefore, I am assuming that you are no longer pursuing this application, and I marked it as Closed (won't fix).

    If this is incorrect, and you are still pursuing this application, then please feel free to re-open it and set the issue status to Needs work or Needs review, depending on the current status of your code.

Production build 0.71.5 2024