Skip to content

Commit

Permalink
Merge pull request #15 from Zemistr/master
Browse files Browse the repository at this point in the history
Add exclusion for non-person person
  • Loading branch information
dfridrich committed Apr 22, 2016
2 parents 93e3c3f + 7fae9ab commit 216b441
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Justice.php
Expand Up @@ -61,12 +61,15 @@ public function findById($id)
$crawler->filter('.aunp-content .div-table')->each(function (Crawler $table) use (&$people) {
$title = $table->filter('.vr-hlavicka')->text();

if ('jednatel: ' === $title) {
$person = JusticeJednatelPersonParser::parseFromDomCrawler($table);
$people[$person->getName()] = $person;
} elseif ('Společník: ' === $title) {
$person = JusticeSpolecnikPersonParser::parseFromDomCrawler($table);
$people[$person->getName()] = $person;
try {
if ('jednatel: ' === $title) {
$person = JusticeJednatelPersonParser::parseFromDomCrawler($table);
$people[$person->getName()] = $person;
} elseif ('Společník: ' === $title) {
$person = JusticeSpolecnikPersonParser::parseFromDomCrawler($table);
$people[$person->getName()] = $person;
}
} catch (\Exception $e) {
}
});

Expand Down

0 comments on commit 216b441

Please sign in to comment.