Integrating PHP_CodeSniffer (PHPCS) and PHPStan into a GitLab CI/CD pipeline helps maintain high code quality. PHPCS ensures adherence to coding standards, while PHPStan performs static analysis to identify potential issues. Running these tools automatically on every Merge Request (MR) helps catch code style violations and bugs early, promoting consistent and reliable code.
Now there are few problems:
FILE: markerio.module
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
39 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: src/Form/SettingsForm.php
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
47 | WARNING | Possible useless method overriding detected
-----------------------------------------------------------------------------------------
Time: 81ms; Memory: 12MB
------ -----------------------------------------------------------------------------------------
Line markerio.module
------ -----------------------------------------------------------------------------------------
15 Function markerio_page_attachments() has no return type specified.
15 Function markerio_page_attachments() has parameter $attachments with no type specified.
------ -----------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------------------------------------------------------------
Line src/Form/SettingsForm.php
------ ------------------------------------------------------------------------------------------------------------------------------------
23 Method Drupal\markerio\Form\SettingsForm::getEditableConfigNames() return type has no value type specified in iterable type array.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iter...
30 Method Drupal\markerio\Form\SettingsForm::buildForm() has parameter $form with no value type specified in iterable type array.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iter...
30 Method Drupal\markerio\Form\SettingsForm::buildForm() return type has no value type specified in iterable type array.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iter...
47 Method Drupal\markerio\Form\SettingsForm::validateForm() has no return type specified.
47 Method Drupal\markerio\Form\SettingsForm::validateForm() has parameter $form with no value type specified in iterable type array.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iter...
54 Method Drupal\markerio\Form\SettingsForm::submitForm() has no return type specified.
54 Method Drupal\markerio\Form\SettingsForm::submitForm() has parameter $form with no value type specified in iterable type array.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iter...
------ ------------------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 9 errors
Issue fork markerio-3494396
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anna d commentedComment #4
anna d commentedComment #5
rohan_singh commentedHi @anna d,
Everything looks good overall, but there’s a cspell issue reported in the pipeline.
Since it’s not significant enough to create a separate issue, it would be better to address it here.
Moving to Needs Work.
Comment #6
anna d commentedComment #8
macsim commentedAdded a
phpcs.xmlto include PHPCS DrupalPractice standards. By default only the Drupal set of rules is usedComment #9
tijsdeboeckThanks for the contribution, we'll work on the module in the coming weeks, and test and merge this one too.
Comment #11
tijsdeboeckMerged, new release is available (1.0.5)
Comment #13
tijsdeboeck