- Issue created by @sunil jolapara
- šŗšøUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051
- Merge request !2Resolve #3476395 "Fix the phpcodesniffer issues" ā (Open) created by sunil jolapara
- šŗšøUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051
- š®š¹Italy apaderno Brescia, š®š¹
The issue summary for PHP_CodeSniffer issues should always show the report given from PHP_CodeSniffer and the arguments passed to
phpcs
.Furthermore, since GitLab CI is now enabled for all the projects, GitLab CI should be used to get PHP_CodeSniffer errors/warnings.
- šµšPhilippines cleavinjosh
Hi @sunil jolapara,
Thank you for providing an MR. I Applied MR!2, it was applied smoothly and fixed most of the phpcs issues.
These are the remaining issues after I ranphpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
:ā prefetcher git:(8.x-1.x) curl https://git.drupalcode.org/project/prefetcher/-/merge_requests/2.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 50784 0 50784 0 0 104k 0 --:--:-- --:--:-- --:--:-- 104k patching file prefetcher.drush.inc patching file prefetcher.install patching file prefetcher.links.menu.yml patching file prefetcher.module patching file src/Commands/PrefetcherCommands.php patching file src/Controller/CrawlController.php patching file src/CrawlerInterface.php patching file src/Entity/PrefetcherUri.php patching file src/Entity/PrefetcherUriInterface.php patching file src/Entity/PrefetcherUriType.php patching file src/Entity/PrefetcherUriViewsData.php patching file src/Form/ImportPrefetcherUrisForm.php patching file src/Form/ImportSitemapForm.php patching file src/Form/PrefetcherConfigForm.php patching file src/Form/PrefetcherUriForm.php patching file src/Form/PrefetcherUriSettingsForm.php patching file src/Plugin/PrefetcherCrawler/CrawlerBasic.php patching file src/Plugin/views/field/PrefetcherLabel.php patching file src/PrefetcherCrawlerManager.php patching file src/PrefetcherImporterService.php patching file src/PrefetcherUriAccessControlHandler.php patching file src/PrefetcherUriTranslationHandler.php patching file src/Tests/LoadTest.php ā prefetcher git:(8.x-1.x) ā .. ā contrib git:(main) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml prefetcher FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/ImportPrefetcherUrisForm.php -------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------------------------------- 112 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead -------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/PrefetcherConfigForm.php ---------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES ---------------------------------------------------------------------------------------------------------------------------------------------- 159 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 193 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 218 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 223 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 228 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 238 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 246 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 343 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 351 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 368 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ---------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/PrefetcherUriForm.php ------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------------- 22 | WARNING | Unused variable $entity. ------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUri.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------- 64 | WARNING | Possible useless method overriding detected ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUriViewsData.php -------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES -------------------------------------------------------------------------------------------------------------------------------------------------- 21 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 23 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 24 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead -------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUriInterface.php -------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES -------------------------------------------------------------------------------------------------------------------------------------------------- 15 | WARNING | There must be no blank line following an inline comment 23 | WARNING | There must be no blank line following an inline comment 34 | WARNING | There must be no blank line following an inline comment -------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Plugin/PrefetcherCrawler/CrawlerBasic.php ---------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES ---------------------------------------------------------------------------------------------------------------------------------------------------------- 375 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 381 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 386 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 391 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 396 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 401 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 408 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ---------------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Service/Prefetcher.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 161 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 172 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 200 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 212 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 223 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 235 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 248 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 249 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ Time: 957ms; Memory: 14MB ā contrib git:(main) ā
Thank you.
- šµšPhilippines cleavinjosh
cleavinjosh ā changed the visibility of the branch 3476395-resolve-phpcs-issues to hidden.
- šµšPhilippines cleavinjosh
Hi,
Please check and advise on the issues found when running the
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
on local.ā contrib git:(main) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml prefetcher FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/ImportPrefetcherUrisForm.php -------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------------------------------- 112 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead -------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/PrefetcherConfigForm.php ---------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES ---------------------------------------------------------------------------------------------------------------------------------------------- 159 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 193 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 218 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 223 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 228 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 238 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 246 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 343 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 351 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 368 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ---------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/PrefetcherUriForm.php ------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------------- 22 | WARNING | Unused variable $entity. ------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUriViewsData.php -------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES -------------------------------------------------------------------------------------------------------------------------------------------------- 21 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 23 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 24 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead -------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUriInterface.php -------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES -------------------------------------------------------------------------------------------------------------------------------------------------- 15 | WARNING | There must be no blank line following an inline comment 23 | WARNING | There must be no blank line following an inline comment 34 | WARNING | There must be no blank line following an inline comment -------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Plugin/PrefetcherCrawler/CrawlerBasic.php ---------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES ---------------------------------------------------------------------------------------------------------------------------------------------------------- 375 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 381 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 386 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 391 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 396 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 401 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 408 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ---------------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Service/Prefetcher.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 161 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 172 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 200 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 212 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 223 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 235 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 248 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 249 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ Time: 913ms; Memory: 14MB ā contrib git:(main) ā
Thank you.