The constructor signature contains one or more unused parameters. Since these are nowhere used in the class, it can be safely removed.
isset
PHP-W1040isset
is either used with an undefined variable or a variable that is known to be defined and non-null.
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.
This issue is raised when a function is declared inside another function or method. The nested function is always created in the global scope and not in the enclosing function or method's scope.
This will also lead to a Fatal Error
during runtime if the enclosing function or method is called more than once.
This happens because the enclosed function is defined in the Global scope when the enclosing function is called the first time. On subsequent calls, PHP will find the enclosed function already defined and run into an error.
It is therefore recommended to refactor it to an anonymous function/closure, class method, or a top-level-defined function.
use
PHP-W1039One or more variables mentioned in the closure's use
clause are unused.
It is recommended to remove them from the use
clause.