| 1 | <?php |
||
| 6 | class Stopwatch { |
||
| 7 | private $accrued = 0; |
||
| 8 | private $timestamp; |
||
| 9 | private $running = false; |
||
| 10 | |||
| 11 | public function __construct() { |
||
| 14 | |||
| 15 | private function getTimestamp(): float { |
||
| 18 | |||
| 19 | private function accrue(): void { |
||
| 22 | |||
| 23 | public function start(): void { |
||
| 32 | |||
| 33 | public function read(): float { |
||
| 39 | |||
| 40 | public function stop(): float { |
||
| 45 | } |
||
| 46 |
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.