Php coding standads

Created on 23 January 2025, 8 days ago

Problem/Motivation

There are lot of php errors, warnings.

Steps to reproduce

Run Drupal phpcs.

Proposed resolution

Fix reported warnings, errors: use dependency injections, remove not used code, fix code format, etc.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

šŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

šŸ‡­šŸ‡ŗHungary szato

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

Comments & Activities

  • Issue created by @szato
  • šŸ‡­šŸ‡ŗHungary szato

    Attached patch file.

  • šŸ‡­šŸ‡ŗHungary szato
  • šŸ‡µšŸ‡­Philippines paraderojether

    Hi szato,

    I reviewed patch #2, applied it against File De-duplicator 1.2.2, and confirmed it fixes the issues reported by phpcs.

    āžœ  file_de_duplicator git:(main) āœ— curl https://www.drupal.org/files/issues/2025-01-23/phpcs-fixes.3501752-2.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 24380  100 24380    0     0  46707      0 --:--:-- --:--:-- --:--:-- 47339
    patching file drush.services.yml
    patching file file_de_duplicator.module
    patching file file_de_duplicator.permissions.yml
    patching file file_de_duplicator.routing.yml
    patching file file_de_duplicator.services.yml
    patching file 'src/Commands/DeDuplicator.php'
    patching file 'src/Controller/DuplicatesController.php'
    patching file 'src/DuplicateFinder.php'
    patching file 'src/Form/FindDuplicatesForm.php'
    āžœ  file_de_duplicator git:(main) āœ— cd ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig file_de_duplicator
    āžœ  contrib git:(main) āœ—

    Moving this RTBC.
    Thank you.

Production build 0.71.5 2024