Setup Gitlab Pipelines & Code Standards

Created on 17 December 2024, 24 days ago

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

๐Ÿ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ฆUkraine Anna D

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024