PHP

PHP

By DeepSource

Use of nested `switch` statements foundPHP-W1091
Anti-pattern

Nested switch statements are difficult to understand and affect code readability. In addition, it is considered a code smell since they are harder to maintain and can easily be confused with the outer switch statement. Therefore it is recommended to avoid using nested switch statements or consider moving the inner switch to another function/method.

Unused private class method foundPHP-W1076
Anti-pattern
Autofix

The class contains unused private methods. These private class methods are dead code, and do nothing. It is recommended to remove these unused private methods.

It is also recommended that you review these unused private methods if they were added for later use in the code, but the author missed using them.

Unused constructor parameterPHP-W1037
Anti-pattern

The constructor signature contains one or more unused parameters. Since these are nowhere used in the class, it can be safely removed.

Empty block of code foundPHP-W1085
Anti-pattern
Autofix

An empty block is considered as dead code as it doesn't do anything. The issue is raised when loops, conditionals, or other statements contains empty body which implies some piece of code is missing.

It is advised to remove the empty block since keeping them in the codebase wastes computation time and memory.