Skip to content

Commit 216b441

Browse files
committed
Merge pull request #15 from Zemistr/master
Add exclusion for non-person person
2 parents 93e3c3f + 7fae9ab commit 216b441

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Justice.php

+9-6
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ public function findById($id)
6161
$crawler->filter('.aunp-content .div-table')->each(function (Crawler $table) use (&$people) {
6262
$title = $table->filter('.vr-hlavicka')->text();
6363

64-
if ('jednatel: ' === $title) {
65-
$person = JusticeJednatelPersonParser::parseFromDomCrawler($table);
66-
$people[$person->getName()] = $person;
67-
} elseif ('Společník: ' === $title) {
68-
$person = JusticeSpolecnikPersonParser::parseFromDomCrawler($table);
69-
$people[$person->getName()] = $person;
64+
try {
65+
if ('jednatel: ' === $title) {
66+
$person = JusticeJednatelPersonParser::parseFromDomCrawler($table);
67+
$people[$person->getName()] = $person;
68+
} elseif ('Společník: ' === $title) {
69+
$person = JusticeSpolecnikPersonParser::parseFromDomCrawler($table);
70+
$people[$person->getName()] = $person;
71+
}
72+
} catch (\Exception $e) {
7073
}
7174
});
7275

0 commit comments

Comments
 (0)