1 | <?php |
||
13 | final class Justice |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | const URL_BASE = 'https://or.justice.cz/ias/ui/'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | const URL_SUBJECTS = 'https://or.justice.cz/ias/ui/rejstrik-$firma?ico=%d'; |
||
24 | |||
25 | /** |
||
26 | * @var Client |
||
27 | */ |
||
28 | private $client; |
||
29 | |||
30 | /** |
||
31 | * Justice constructor. |
||
32 | * |
||
33 | * @param Client $client |
||
34 | */ |
||
35 | public function __construct(Client $client) |
||
39 | |||
40 | /** |
||
41 | * @param int $id |
||
42 | * |
||
43 | * @throws SubjectNotFoundException |
||
44 | * |
||
45 | * @return JusticeRecord|false |
||
46 | */ |
||
47 | public function findById($id) |
||
79 | |||
80 | /** |
||
81 | * @param Crawler $crawler |
||
82 | * |
||
83 | * @return false|string |
||
84 | */ |
||
85 | private function extractDetailUrlFromCrawler(Crawler $crawler) |
||
99 | } |
||
100 |
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: