Fix coding standards and improve code.

Created on 11 July 2024, 3 months ago
Updated 15 July 2024, 3 months ago

Problem/Motivation

I am interested in helping improve the module's code. PHPCS shows lots of things to be fixed. I understand this branch is in early development, but integrating the fixes/changes early will help avoid mistakes. I recommend type safety and using a PHPCS integration for your IDE.

Steps to reproduce

Run PHPCS.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

RTBC

Version

3.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @solideogloria
  • Status changed to Needs review 3 months ago
  • I will note that I have never used this module, so I'm new to how it worked in Drupal 7 or should be expected to work in Drupal 10. However, I have experience with programming in Drupal, so I'm willing to help improve the code base.

  • Pipeline finished with Success
    3 months ago
    Total: 136s
    #222187
  • Pipeline finished with Success
    3 months ago
    Total: 234s
    #222190
  • Pipeline finished with Success
    3 months ago
    #222202
  • Status changed to Needs work 3 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi

    I applied MR !1 into the module and there's still a few PHPCS issues

    โžœ  bible git:(3.0.x) curl https://git.drupalcode.org/project/bible/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 31691    0 31691    0     0  57322      0 --:--:-- --:--:-- --:--:-- 58362
    patching file .gitignore
    patching file .gitlab-ci.yml
    patching file README.md
    patching file bible.info.yml
    patching file bible.module
    patching file 'config/install/core.entity_view_display.bible.bible.default.yml'
    patching file 'src/BibleBookInterface.php'
    patching file 'src/BibleInterface.php'
    patching file 'src/BibleListBuilder.php'
    patching file 'src/Entity/Bible.php'
    patching file 'src/Entity/BibleBook.php'
    patching file 'src/Entity/BibleConcordance.php'
    patching file 'src/Entity/BibleNote.php'
    patching file 'src/Entity/BibleVerse.php'
    patching file 'src/Form/BibleForm.php'
    patching file 'src/Form/BibleImportForm.php'
    patching file 'src/Form/BibleSettingsForm.php'
    โžœ  bible git:(3.0.x) โœ— ..
    โžœ  contrib git:(main) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml bible        
    
    FILE: ...ubing-subing/Projects/d10/drupal_local/web/modules/contrib/bible/README.md
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
    --------------------------------------------------------------------------------
      3 | WARNING | Line exceeds 80 characters; contains 234 characters
      5 | WARNING | Line exceeds 80 characters; contains 91 characters
      7 | WARNING | Line exceeds 80 characters; contains 99 characters
      8 | WARNING | Line exceeds 80 characters; contains 120 characters
      9 | WARNING | Line exceeds 80 characters; contains 115 characters
     17 | WARNING | Line exceeds 80 characters; contains 99 characters
    --------------------------------------------------------------------------------
    
    
    FILE: ...ts/d10/drupal_local/web/modules/contrib/bible/src/Form/BibleImportForm.php
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
    --------------------------------------------------------------------------------
     249 | ERROR   | The array declaration extends to column 83 (the limit is 80).
         |         | The array content should be split up over multiple lines
     260 | ERROR   | The $_FILES super global must not be accessed directly; inject
         |         | the request_stack service and use
         |         | $stack->getCurrentRequest()->files->get('files') instead
     408 | WARNING | t() calls should be avoided in classes, use
         |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
         |         | $this->t() instead
    --------------------------------------------------------------------------------
    
    Time: 518ms; Memory: 12MB
    
    โžœ  contrib git:(main) โœ— 
    
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev2.addweb

    nilesh.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev2.addweb

    Hello,

    I've resolved the above mentioned issues.

  • Status changed to RTBC 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia riddhi.addweb

    The mentioned page issue is resolved, & I have also checked and it is working as expected. I am attaching the Screenshots & doing RTBC for the same.

Production build 0.71.5 2024