| 1 | <?php declare(strict_types=1); |
||
| 8 | final class MeasureMiddleware |
||
| 9 | { |
||
| 10 | /** @var int */ |
||
| 11 | private $current = 0; |
||
| 12 | |||
| 13 | /** @var int */ |
||
| 14 | private $total = 0; |
||
| 15 | |||
| 16 | /** @var null|float */ |
||
| 17 | private $tookMin = null; |
||
| 18 | |||
| 19 | /** @var float */ |
||
| 20 | private $tookMax = 0.0; |
||
| 21 | |||
| 22 | /** @var float */ |
||
| 23 | private $tookAvg = 0.0; |
||
| 24 | |||
| 25 | /** @var float */ |
||
| 26 | private $tookTotal = 0.0; |
||
| 27 | |||
| 28 | 1 | public function __invoke(ServerRequestInterface $request, callable $next) |
|
| 50 | |||
| 51 | 1 | public function collect(): iterable |
|
| 66 | |||
| 67 | public function cancel(): void |
||
| 71 | } |
||
| 72 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.