Problem/Motivation
$ vendor/bin/phpcs -s $_WEB_ROOT/modules/custom --report-junit=junit.xml --report-full --report-summary --report-source $_PHPCS_EXTRA
FILE: ...r/web/modules/custom/config_provider/src/ConfigProviderConfigInstaller.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------
9 | ERROR | [x] Missing class doc comment
| | (Drupal.Commenting.ClassComment.Missing)
16 | ERROR | [x] Data types in @param tags need to be fully namespaced
| | (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
19 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 2
| | spaces
| | (Drupal.Commenting.FunctionComment.ParamCommentIndentation)
34 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
| | (Drupal.Commenting.InlineVariableComment.VarInline)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...er/web/modules/custom/config_provider/src/Plugin/ConfigProviderManager.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Cache\CacheBackendInterface.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: .../web/modules/custom/config_provider/src/Plugin/ConfigProviderInterface.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
17 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
| | (Drupal.Commenting.DocComment.ShortSingleLine)
44 | ERROR | [ ] Parameter $active_storage is not described in comment
| | (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
47 | ERROR | [ ] Doc comment for parameter $storage does not match actual
| | variable name $active_storage
| | (Drupal.Commenting.FunctionComment.ParamNameNoMatch)
68 | ERROR | [ ] Parameter $config_to_create is not described in comment
| | (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
78 | ERROR | [x] Data types in @param tags need to be fully namespaced
| | (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...vider/web/modules/custom/config_provider/src/Plugin/ConfigProviderBase.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
208 | ERROR | [x] list(...) is forbidden, use [...] instead.
| | (SlevomatCodingStandard.PHP.ShortList.LongListUsed)
222 | ERROR | [x] Case breaking statements must be followed by a single
| | blank line
| | (Squiz.ControlStructures.SwitchDeclaration.SpacingAfterBreak)
252 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
| | (Drupal.Commenting.InlineVariableComment.VarInline)
269 | ERROR | [ ] Missing parameter type
| | (Drupal.Commenting.FunctionComment.MissingParamType)
272 | ERROR | [ ] Missing parameter type
| | (Drupal.Commenting.FunctionComment.MissingParamType)
299 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
| | (Drupal.Files.LineLength.TooLong)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...provider/web/modules/custom/config_provider/src/Plugin/ConfigCollector.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
87 | ERROR | [ ] The trigger_error message 'Install profile will be a
| | mandatory parameter in Drupal 9.0.' does not match the
| | relaxed standard format: %thing% is deprecated in
| | %deprecation-version% any free text %removal-version%.
| | %extra-info%. See %cr-link%
| | (Drupal.Semantics.FunctionTriggerError.TriggerErrorTextLayoutRelaxed)
117 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
| | (Drupal.Commenting.InlineVariableComment.VarInline)
143 | ERROR | [x] Expected 1 newline at end of file; 2 found
| | (Drupal.Files.EndFileNewline.TooMany)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...ustom/config_provider/src/Plugin/ConfigProvider/ConfigProviderOptional.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
| | (Drupal.Classes.UnusedUseStatement.UnusedUse)
7 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is
| | Drupal\Core\Config\Entity\ConfigDependencyManager.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
66 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
| | (Drupal.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 193ms; Memory: 6MB
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE ERRORS WARNINGS
--------------------------------------------------------------------------------
...ustom/config_provider/src/ConfigProviderConfigInstaller.php 3 1
...dules/custom/config_provider/src/Plugin/ConfigCollector.php 2 1
...es/custom/config_provider/src/Plugin/ConfigProviderBase.php 4 2
...stom/config_provider/src/Plugin/ConfigProviderInterface.php 5 0
...custom/config_provider/src/Plugin/ConfigProviderManager.php 1 0
...ovider/src/Plugin/ConfigProvider/ConfigProviderOptional.php 2 1
--------------------------------------------------------------------------------
A TOTAL OF 17 ERRORS AND 5 WARNINGS WERE FOUND IN 13 FILES
--------------------------------------------------------------------------------
PHPCBF CAN FIX 14 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------------------
SOURCE COUNT
--------------------------------------------------------------------------------
[x] Drupal.Commenting.InlineVariableComment.VarInline 3
[x] Drupal.Commenting.DataTypeNamespace.DataTypeNamespace 2
[ ] Drupal.Commenting.FunctionComment.MissingParamType 2
[ ] Drupal.Commenting.FunctionComment.ParamMissingDefinition 2
[x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl 2
[x] Drupal.Classes.UnusedUseStatement.UnusedUse 1
[x] Drupal.Commenting.ClassComment.Missing 1
[ ] Drupal.Commenting.DocComment.ShortSingleLine 1
[x] Drupal.Commenting.FunctionComment.ParamCommentIndentation 1
[ ] Drupal.Commenting.FunctionComment.ParamNameNoMatch 1
[x] Drupal.Files.EndFileNewline.TooMany 1
[ ] Drupal.Files.LineLength.TooLong 1
[x] Drupal.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction 1
[ ] Drupal.Semantics.FunctionTriggerError.TriggerErrorTextLayoutRelaxed 1
[x] SlevomatCodingStandard.PHP.ShortList.LongListUsed 1
[x] Squiz.ControlStructures.SwitchDeclaration.SpacingAfterBreak 1
--------------------------------------------------------------------------------
A TOTAL OF 22 SNIFF VIOLATIONS WERE FOUND IN 16 SOURCES
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SOURCES AUTOMATICALLY (14 VIOLATIONS IN TOTAL)
--------------------------------------------------------------------------------
$ php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --no-progress || EXIT_CODE=$?
------ ----------------------------------------------------------------------
Line src/ConfigProviderConfigInstaller.php
------ ----------------------------------------------------------------------
38 \Drupal calls should be avoided in classes, use dependency injection
instead
------ ----------------------------------------------------------------------
------ ------------------------------------------------------
Line src/Plugin/ConfigProvider/ConfigProviderOptional.php
------ ------------------------------------------------------
92 Undefined variable: $dependency
92 Undefined variable: $dependency
------ ------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Plugin/ConfigProviderBase.php
------ ----------------------------------------------------------------------
65 Access to undefined constant
static(Drupal\config_provider\Plugin\ConfigProviderBase)::ID.
282 \Drupal calls should be avoided in classes, use dependency injection
instead
------ ----------------------------------------------------------------------
------ ---------------------------------------------------------------------
Line tests/src/Kernel/ConfigCollectorTest.php
------ ---------------------------------------------------------------------
36 You should use assertTrue() instead of assertSame() when expecting
"true"
37 You should use assertFalse() instead of assertSame() when expecting
"false"
------ ---------------------------------------------------------------------
[ERROR] Found 7 errors
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #3
joegraduateComment #4
joegraduateDecided it'd be easier to tackle PHPCS and PHPStan issues together since there is some overlap.
Comment #5
joegraduateMoved method deprecations changes to #3500568: Deprecate ConfigProviderBase drupalGetPath() and drupalGetProfile() methods.
Comment #6
paraderojether commentedHi
I reviewed MR!9, and confirmed PHPCS & PHPStan issues are fixed on the Gitlab CI
However, I noticed a phpcs issue using PHP_CodeSniffer:
Command used:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig config_providerKindly check and advise, please.
Thank you.
Comment #7
Anonymous (not verified) commentedHi @paraderojether
Since Gitlab CI has been added to Drupal, It is used to find errors for coding standards. If the pipeline is passing, re-run the pipeline to test that it is passing and if the job succeeds, the standards are considered correct.
You can re-run the pipeline on this issue and if it passes, feel free to move it to RTBC+
Comment #8
joegraduateComment #9
trackleft2All tests are passing, additionally, the gitlab-ci.yml update and dependency injection updates look good to me.
Comment #11
joegraduateThanks all. Merged.
Comment #13
skrugI know this is closed but for some reason this commit breaks the ability to use the "--update-mode" option for "drush cd-update". It's not available anymore.
Comment #14
joegraduate@skrug Could you create a new issue with as many details as possible?
Comment #15
tadean@skrug @joegraduate It appears that the changes in this commit to ConfigCollector which adds ExtensionPathResolver as a final argument are breaking this feature within
config_sync, becauseconfig_syncsubclassesConfigCollectorviaDrupal\config_sync\Plugin\SyncConfigCollector.Without that API change of the additional argument also being present in
config_syncin theconfig_sync.collectorservice, the drush command gives the following errors:and:
Comment #16
joegraduateCreated a separate follow-up issue to fix this: #3511302: Add BC for breaking API change made in #3457459 that broke config_sync.