| 1 | <?php |
||
| 12 | class AuthMiddleware |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Middleware invokable class method. |
||
| 16 | * |
||
| 17 | * @param \Psr\Http\Message\ServerRequestInterface $request PSR7 request |
||
| 18 | * @param \Psr\Http\Message\ResponseInterface $response PSR7 response |
||
| 19 | * @param callable $next Next middleware |
||
| 20 | * |
||
| 21 | * @return \Psr\Http\Message\ResponseInterface |
||
| 22 | */ |
||
| 23 | public function __invoke($request, $response, $next) |
||
| 42 | } |
||
| 43 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.