Fix the issues reported by phpcs

Created on 12 July 2019, over 5 years ago
Updated 21 August 2024, 3 months ago
šŸ“Œ 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.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

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, šŸ‡®šŸ‡¹

    There are not issues left: The report is based only on the Drupal standard, not Drupal and DrupalPractice standards.
    It is not clear why only a standard has been used to check the code, though.

  • Status changed to Needs work 4 months ago
  • Hi @urvashi_vora,

    After applying your patch, there are more than errors reported by my terminal than what you reported. Please see below:

    āžœ  imageapi_optimize git:(8.x-2.x) curl https://www.drupal.org/files/issues/2022-06-24/coding-standard-fix-3067484-5.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 45915  100 45915    0     0   145k      0 --:--:-- --:--:-- --:--:--  150k
    patching file README.md
    patching file imageapi_optimize.api.php
    patching file imageapi_optimize.info.yml
    patching file imageapi_optimize.install
    patching file imageapi_optimize.module
    patching file src/Annotation/ImageAPIOptimizeProcessor.php
    patching file src/Entity/ImageAPIOptimizePipeline.php
    patching file src/Entity/ImageStyleWithPipeline.php
    patching file src/Exception/PluginNotFoundException.php
    patching file src/Form/ImageAPIOptimizeDefaultPipelineConfigForm.php
    patching file src/Form/ImageAPIOptimizePipelineDeleteForm.php
    patching file src/Form/ImageAPIOptimizePipelineEditForm.php
    patching file src/Form/ImageAPIOptimizeProcessorDeleteForm.php
    patching file src/Form/ImageAPIOptimizeProcessorFormBase.php
    patching file src/ImageAPIOptimizeHookImplementations.php
    patching file src/ImageAPIOptimizePipelineInterface.php
    patching file src/ImageAPIOptimizePipelineListBuilder.php
    patching file src/ImageAPIOptimizePipelineStorage.php
    patching file src/ImageAPIOptimizePipelineStorageInterface.php
    patching file src/ImageAPIOptimizeProcessorBase.php
    patching file src/ImageAPIOptimizeProcessorInterface.php
    patching file src/ImageAPIOptimizeProcessorPluginCollection.php
    patching file tests/module/imageapi_optimize_module_test/src/Plugin/ImageAPIOptimizeProcessor/TestProcessorAppendCharacters.php
    patching file tests/module/imageapi_optimize_module_test/src/Plugin/ImageAPIOptimizeProcessor/TestProcessorBlackPNG.php
    patching file tests/module/imageapi_optimize_module_test/src/Plugin/ImageAPIOptimizeProcessor/TestProcessorFailedGreenPNG.php
    patching file tests/src/Functional/FileMoveTest.php
    patching file tests/src/Functional/ImageAdminStylesTest.php
    patching file tests/src/Functional/ImageDimensionsTest.php
    patching file tests/src/Functional/ImageEffectsTest.php
    patching file tests/src/Functional/ImageFieldDefaultImagesTest.php
    patching file tests/src/Functional/ImageFieldDisplayTest.php
    patching file tests/src/Functional/ImageFieldValidateTest.php
    patching file tests/src/Functional/ImageFieldWidgetTest.php
    patching file tests/src/Functional/ImageOnTranslatedEntityTest.php
    patching file tests/src/Functional/ImageStyleDeleteTest.php
    patching file tests/src/Functional/ImageStyleFlushTest.php
    patching file tests/src/Functional/ImageStylesPathAndUrlTest.php
    patching file tests/src/Functional/QuickEditImageControllerTest.php
    patching file tests/src/Functional/Update/ImageUpdateTest.php
    patching file tests/src/FunctionalJavascript/ImageAdminStylesTest.php
    patching file tests/src/FunctionalJavascript/ImageFieldValidateTest.php
    patching file tests/src/FunctionalJavascript/QuickEditImageTest.php
    patching file tests/src/Kernel/ImageFormatterTest.php
    patching file tests/src/Kernel/ImageImportTest.php
    patching file tests/src/Kernel/ImageItemTest.php
    patching file tests/src/Kernel/ImageOptimizePipelineTest.php
    patching file tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php
    patching file tests/src/Kernel/ImageStyleIntegrationTest.php
    patching file tests/src/Kernel/ImageThemeFunctionTest.php
    patching file tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php
    patching file tests/src/Kernel/Migrate/d7/MigrateImageSettingsTest.php
    patching file tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php
    patching file tests/src/Kernel/Views/ImageViewsDataTest.php
    patching file tests/src/Kernel/Views/RelationshipUserImageDataTest.php
    āžœ  imageapi_optimize git:(8.x-2.x) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig imageapi_optimize
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/imageapi_optimize.install
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------
     9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\imageapi_optimize\Entity\ImageAPIOptimizePipeline.
    --------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/ImageStyleWithPipelineListBuilder.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------
     38 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    ---------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/Form/ImageAPIOptimizeProcessorAddForm.php
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------------------
      7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\imageapi_optimize\ImageAPIOptimizePipelineInterface.
     56 | ERROR | [ ] Protected method name "ImageAPIOptimizeProcessorAddForm::prepareImageAPIOptimizeProcessor" is not in lowerCamel format
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/Form/ImageAPIOptimizeProcessorEditForm.php
    --------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------
     28 | ERROR | Protected method name "ImageAPIOptimizeProcessorEditForm::prepareImageAPIOptimizeProcessor" is not in lowerCamel format
    --------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/Form/ImageAPIOptimizePipelineEditForm.php
    -------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------
     145 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    -------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/Form/ImageAPIOptimizeProcessorFormBase.php
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------------------
      10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Plugin\Exception\PluginNotFoundException.
     146 | ERROR | [ ] Protected method name "ImageAPIOptimizeProcessorFormBase::prepareImageAPIOptimizeProcessor" is not in lowerCamel format
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/ImageAPIOptimizeProcessorPluginCollection.php
    -----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------------
     18 | WARNING | Possible useless method overriding detected
    -----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/Entity/ImageAPIOptimizePipeline.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------------------
      12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\imageapi_optimize\ImageAPIOptimizeProcessorInterface.
     140 | ERROR | [ ] Protected method name "ImageAPIOptimizePipeline::replaceImageAPIOptimizePipeline" is not in lowerCamel format
     268 | ERROR | [ ] Public method name "ImageAPIOptimizePipeline::getReplacementID" is not in lowerCamel format
     295 | ERROR | [ ] Protected method name "ImageAPIOptimizePipeline::getImageAPIOptimizeProcessorPluginManager" is not in lowerCamel format
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/ImageAPIOptimizePipelineStorage.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
     37 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    -------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/ImageAPIOptimizePipelineInterface.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------
     24 | ERROR | Public method name "ImageAPIOptimizePipelineInterface::getReplacementID" is not in lowerCamel format
    ---------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/imageapi_optimize/src/ImageAPIOptimizeHookImplementations.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------
     29 | ERROR | Public method name "ImageAPIOptimizeHookImplementations::entity_type_alter" is not in lowerCamel format
     44 | ERROR | Public method name "ImageAPIOptimizeHookImplementations::form_image_style_edit_form_alter" is not in lowerCamel format
     59 | ERROR | Public method name "ImageAPIOptimizeHookImplementations::config_schema_info_alter" is not in lowerCamel format
    -----------------------------------------------------------------------------------------------------------------------------------------
    

    Kindly check and work on it.

    Thanks,
    Jake

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Let's create a merge request, now that patches are no longer tested.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    avpaderno ā†’ changed the visibility of the branch 3067484-drupal-best-practices to hidden.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Furthermore, the 8.x-2.x branch is no longer supported. Any change must be done on the 4.x-dev branch.

  • Pipeline finished with Failed
    3 months ago
    Total: 137s
    #259963
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
Production build 0.71.5 2024