Fixes for coding standards

Created on 30 September 2022, over 2 years ago
Updated 9 February 2023, about 2 years ago

Problem/Motivation

Run a standard check against the Drupal coding standards (./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md):

FILE: /app/web/modules/contrib/field_encrypt/src/Form/SettingsForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 136 | ERROR | [x] Use null coalesce operator instead of ternary
     |       |     operator.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...pp/web/modules/contrib/field_encrypt/src/Form/EntityTypeForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 184 | ERROR | [x] Use null coalesce operator instead of ternary
     |       |     operator.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: .../field_encrypt/src/Plugin/QueueWorker/UpdateEntityEncryption.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 6 | WARNING | [x] Unused use statement
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...encrypt/src/Plugin/Field/FieldType/EncryptedFieldStorageItem.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 95 | ERROR | unserialize() is insecure unless allowed classes are
    |       | limited. Use a safe format like JSON or use the
    |       | allowed_classes option.
----------------------------------------------------------------------


FILE: ...les/contrib/field_encrypt/tests/src/Functional/KeyChangeTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 38 | WARNING | [x] '@TODO: Simplify setUp() by extending
    |         |     EncryptTestBase when
    |         |     https://www.drupal.org/node/2692387 lands.'
    |         |     should match the format '@todo Fix problem X
    |         |     here.'
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...trib/field_encrypt/tests/src/Functional/FieldEncryptTestBase.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 58 | WARNING | [x] '@TODO: Simplify setUp() by extending
    |         |     EncryptTestBase when
    |         |     https://www.drupal.org/node/2692387 lands.'
    |         |     should match the format '@todo Fix problem X
    |         |     here.'
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...s/contrib/field_encrypt/tests/src/Functional/EntityHooksTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 36 | WARNING | [x] '@TODO: Simplify setUp() by extending
    |         |     EncryptTestBase when
    |         |     https://www.drupal.org/node/2692387 lands.'
    |         |     should match the format '@todo Fix problem X
    |         |     here.'
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...les/contrib/field_encrypt/tests/src/Functional/BaseFieldTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 43 | WARNING | [x] '@TODO: Simplify setUp() by extending
    |         |     EncryptTestBase when
    |         |     https://www.drupal.org/node/2692387 lands.'
    |         |     should match the format '@todo Fix problem X
    |         |     here.'
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...s/contrib/field_encrypt/tests/src/Functional/EncryptUserTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 36 | WARNING | [x] '@TODO: Simplify setUp() by extending
    |         |     EncryptTestBase when
    |         |     https://www.drupal.org/node/2692387 lands.'
    |         |     should match the format '@todo Fix problem X
    |         |     here.'
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...crypt/tests/modules/field_encrypt_test/field_encrypt_test.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 80 | ERROR | [x] Data types in @var tags need to be fully namespaced
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /app/web/modules/contrib/field_encrypt/field_encrypt.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 69 | ERROR | [x] Use null coalesce operator instead of ternary
    |       |     operator.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
πŸ“Œ Task
Status

Fixed

Version

3.1

Component

Code

Created by

πŸ‡―πŸ‡΅Japan ptmkenny

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