| 1 | <?php |
||
| 11 | class Logger |
||
| 12 | { |
||
| 13 | /** @var LoggerStorageInterface */ |
||
| 14 | private $storage; |
||
| 15 | |||
| 16 | /** @var Request */ |
||
| 17 | private $httpRequest; |
||
| 18 | |||
| 19 | /** @var ResolvedRoute */ |
||
| 20 | private $resolvedRoute; |
||
| 21 | |||
| 22 | /** @var BaseHandler */ |
||
| 23 | private $handler; |
||
| 24 | |||
| 25 | /** @var int */ |
||
| 26 | private $start = 0; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param Request $httpRequest |
||
| 30 | * @param LoggerStorageInterface $storage |
||
| 31 | */ |
||
| 32 | 14 | public function __construct(Request $httpRequest, LoggerStorageInterface $storage) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @param ResolvedRoute $resolvedRoute |
||
| 40 | */ |
||
| 41 | 12 | public function setResolvedRoute(ResolvedRoute $resolvedRoute) |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @param BaseHandler $handler |
||
| 48 | */ |
||
| 49 | 8 | public function setHandler(BaseHandler $handler) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Start logging |
||
| 56 | */ |
||
| 57 | 12 | public function start() |
|
| 61 | |||
| 62 | /** |
||
| 63 | * Finish logging |
||
| 64 | * @param ApiResponse $response |
||
| 65 | */ |
||
| 66 | 12 | public function finish(ApiResponse $response) |
|
| 76 | } |
||
| 77 |
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.