- Issue created by @ptmkenny
- @ptmkenny opened merge request.
- Status changed to Needs review
almost 2 years ago 1:14pm 6 February 2023 - šÆšµJapan ptmkenny
The MR fixes all of the issues in the Issue Summary except:
FILE: /var/www/html/web/modules/contrib/consumer_image_styles/src/ImageStylesProvider.php ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 3 WARNINGS AFFECTING 3 LINES ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 80 | WARNING | The deprecation-version '4.0.6' does not match the lower-case machine-name standard: drupal:n.n.n or project:n.x-n.n or project:n.x-n.n-label[n] or project:n.n.n | | or project:n.n.n-label[n] 80 | WARNING | The removal-version '5.0' does not match the lower-case machine-name standard: drupal:n.n.n or project:n.x-n.n or project:n.x-n.n-label[n] or project:n.n.n or | | project:n.n.n-label[n] 81 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 114 | ERROR | The trigger_error message 'Calling %s without $cacheable_metadata is deprecated in 4.0.6; it is required in 5.0.' does not match the relaxed standard format: | | %thing% is deprecated in %deprecation-version% any free text %removal-version%. %extra-info%. See %cr-link% ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/contrib/consumer_image_styles/src/Plugin/jsonapi/FieldEnhancer/ImageStyles.php --------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------- 249 | WARNING | ImageStyle::loadMultiple calls should be avoided in classes, use dependency injection instead ---------------------------------------------------------------------------------------------------------------
I think dependency injection should be handled in a separate issue because it can break things, and I don't know how to fix the deprecation messages.
- Status changed to Needs work
3 months ago 7:21am 21 August 2024 Hi @ptmkenny,
Applied the latest changes committed on MR!13, it was applied successfully on my local, but there are still errors reported aside from dependency injection. Please see below:
ā consumer_image_styles git:(4.x) curl https://git.drupalcode.org/project/consumer_image_styles/-/merge_requests/13.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10311 0 10311 0 0 33997 0 --:--:-- --:--:-- --:--:-- 35555 patching file consumer_image_styles.module patching file src/ImageStylesProvider.php patching file src/ImageStylesProviderInterface.php patching file src/Normalizer/LinkCollectionNormalizer.php patching file src/Plugin/jsonapi/FieldEnhancer/ImageStyles.php patching file tests/src/Functional/ConsumerImageSylesFunctionalTest.php ā consumer_image_styles git:(4.x) ā .. ā contrib git:(master) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig consumer_image_styles FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/consumer_image_styles/src/Plugin/jsonapi/FieldEnhancer/ImageStyles.php -------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------------------------------------------------- 52 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 249 | WARNING | [ ] ImageStyle::loadMultiple calls should be avoided in classes, use dependency injection instead -------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/consumer_image_styles/src/Normalizer/LinkCollectionNormalizer.php --------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------------------------------- 8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\consumer_image_styles\ImageStylesProviderInterface. --------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY --------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/consumer_image_styles/src/ImageStylesProvider.php ------------------------------------------------------------------------------------------------------------------------------------------------------------ FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 5 LINES ------------------------------------------------------------------------------------------------------------------------------------------------------------ 13 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StreamWrapper\StreamWrapperInterface. 74 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 80 | WARNING | [ ] The deprecation-version '4.0.6' does not match the lower-case machine-name standard: drupal:n.n.n or project:n.x-n.n or | | project:n.x-n.n-label[n] or project:n.n.n or project:n.n.n-label[n] 80 | WARNING | [ ] The removal-version '5.0' does not match the lower-case machine-name standard: drupal:n.n.n or project:n.x-n.n or | | project:n.x-n.n-label[n] or project:n.n.n or project:n.n.n-label[n] 81 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead 114 | ERROR | [ ] The trigger_error message 'Calling %s without $cacheable_metadata is deprecated in 4.0.6; it is required in 5.0.' does not match the | | relaxed standard format: %thing% is deprecated in %deprecation-version% any free text %removal-version%. %extra-info%. See %cr-link% ------------------------------------------------------------------------------------------------------------------------------------------------------------ PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------------------------------------------------ Time: 404ms; Memory: 12MB
Kindly check
Thanks,
Jake- Status changed to Needs review
3 months ago 2:02pm 21 August 2024 - šÆšµJapan ptmkenny
@a.aaronjake These are the coding standards/phpcs fixes for the CI test run by the GitLab CI template. The CI template classifies DI issues as phpstan issues, not phpcs issues (this is done to prevent the issues from being fixed twice in different issues).
The issue to add the CI template is here: š Add gitlab CI Needs review