Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
29 | private function getModifiedSince(Request $request):\DateTime |
||
30 | { |
||
31 | if ($request->headers->has(self::HTTP_HEADER_NAME)) { |
||
32 | $string = $request->headers->get(self::HTTP_HEADER_NAME); |
||
33 | return \DateTime::createFromFormat(\DateTime::RSS, $string); |
||
34 | } |
||
35 | |||
36 | return new \DateTime('@1'); |
||
37 | } |
||
38 | } |
||
39 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: