18 lines
456 B
PHP
18 lines
456 B
PHP
<?php
|
|
|
|
namespace App\BusProNet\XmlParser;
|
|
|
|
use App\BusProNet\Model\Notification;
|
|
use Symfony\Component\DomCrawler\Crawler;
|
|
|
|
class NotificationParser extends AbstractParser
|
|
{
|
|
public function parse(Crawler $result): Notification
|
|
{
|
|
$number = $this->getIntOrNullValue($result->filterXPath('//satz/nr'));
|
|
$text = $this->getStringOrNullValue($result->filterXPath('//satz/text'));
|
|
|
|
return new Notification($number, $text);
|
|
}
|
|
}
|