Fix code style issues reported by phpcs

Created on 2 June 2025, 6 days ago

Problem/Motivation

The CI phpcs test reports,

FILE: .../key_auth/web/modules/custom/key_auth/tests/src/Functional/KeyAuthTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
295 | ERROR | [x] Parameter $user has null default value, but is not marked as
| | nullable.
| | (SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilityTypeMissing)
--------------------------------------------------------------------------------
FILE: ...ilds/project/key_auth/web/modules/custom/key_auth/src/KeyAuthInterface.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
| | (Drupal.Commenting.ClassComment.Short)
--------------------------------------------------------------------------------
FILE: /builds/project/key_auth/web/modules/custom/key_auth/src/KeyAuth.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
| | (Drupal.Classes.UnusedUseStatement.UnusedUse)
5 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be
| | referenced with use statements
| | (Drupal.Classes.UseGlobalClass.RedundantUseStatement)
--------------------------------------------------------------------------------
FILE: .../project/key_auth/web/modules/custom/key_auth/src/Form/UserKeyAuthForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
69 | ERROR | [x] Parameter $user has null default value, but is not marked as
| | nullable.
| | (SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilityTypeMissing)
--------------------------------------------------------------------------------
FILE: ...ject/key_auth/web/modules/custom/key_auth/src/Form/KeyAuthSettingsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
| | (Drupal.Commenting.ClassComment.Short)
--------------------------------------------------------------------------------

Steps to reproduce

https://git.drupalcode.org/project/key_auth/-/jobs/4598849

Proposed resolution

follow the advice

Remaining tasks

make a MR

πŸ“Œ Task
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States BenStallings

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