PHPCS reported errors and warnings

Created on 6 January 2023, almost 2 years ago
Updated 30 March 2023, over 1 year ago

PHPCS reported the following errors and warining:

FILE: /metatag_import_export_csv/tests/src/Kernel/MetatagImportTest.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 24 ERRORS AFFECTING 23 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
 169 | ERROR | The array declaration extends to column 103 (the limit is 80). The array content should be split up over multiple lines
 174 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
 176 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
 190 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 193 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 197 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 200 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 204 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 207 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 211 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 213 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 216 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 220 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 222 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 236 | ERROR | Parameter tags must be defined first in a doc comment
 241 | ERROR | Type hint "array" missing for $headers
 241 | ERROR | Type hint "array" missing for $data
 254 | ERROR | Doc comment short description must end with a full stop
 259 | ERROR | The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
 263 | ERROR | The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
 267 | ERROR | The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
 279 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
 283 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
 287 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------------


FILE: /metatag_import_export_csv/src/Form/MetaTagUploadForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 29 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 49 | WARNING | File::load calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /metatag_import_export_csv/src/Form/MetaTagDownloadForm.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
  65 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  83 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 111 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 123 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 149 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 151 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 156 | WARNING | [x] 'TODO: Generalise this.' should match the format '@todo Fix problem X here.'
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /metatag_import_export_csv/src/MetatagImport.php
----------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 7 WARNINGS AFFECTING 15 LINES
----------------------------------------------------------------------------------------------------------------
   6 | ERROR   | [x] When importing a class with "use", do not include a leading \
  61 | ERROR   | [ ] Type hint "array" missing for $headers
  61 | ERROR   | [ ] Type hint "array" missing for $filepath
  61 | ERROR   | [ ] Type hint "array" missing for $context
 123 | ERROR   | [ ] Return type missing for @return tag in function comment
 129 | ERROR   | [ ] Type hint "array" missing for $headers
 129 | ERROR   | [ ] Type hint "array" missing for $data
 130 | ERROR   | [x] Equals sign not aligned with surrounding assignments; expected 1 space but found 2 spaces
 131 | ERROR   | [x] Equals sign not aligned with surrounding assignments; expected 3 spaces but found 4 spaces
 132 | ERROR   | [x] Equals sign not aligned with surrounding assignments; expected 4 spaces but found 5 spaces
 133 | ERROR   | [x] Equals sign not aligned with surrounding assignments; expected 2 spaces but found 3 spaces
 146 | WARNING | [ ] Exceptions should not be translated
 162 | WARNING | [ ] Exceptions should not be translated
 171 | WARNING | [ ] Exceptions should not be translated
 180 | WARNING | [ ] Exceptions should not be translated
 189 | WARNING | [ ] Exceptions should not be translated
 198 | WARNING | [ ] Exceptions should not be translated
 226 | WARNING | [ ] Exceptions should not be translated
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------


FILE: /metatag_import_export_csv/src/MetatagExport.php
----------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------
 29 | WARNING | [ ] Unused variable $field_name.
 73 | ERROR   | [x] Expected one space after the comma, 0 found
 73 | ERROR   | [x] Space found before comma in argument list
 73 | ERROR   | [x] Expected one space after the comma, 0 found
 93 | WARNING | [ ] Only string literals should be passed to t() where possible
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------
πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany solimanharkas Hamburg

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024