1 | <?php |
||
17 | class Departures extends AbstractParser { |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $currentTime; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $station; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $departureObjects = array(); |
||
33 | |||
34 | /** |
||
35 | * @param $htmlResponse |
||
36 | */ |
||
37 | public function __construct($htmlResponse) { |
||
38 | |||
39 | parent::__construct($htmlResponse); |
||
40 | |||
41 | $html = $this->getHtmlResponse(); |
||
42 | phpQuery::newDocumentHTML($html); |
||
|
|||
43 | $tableRows = pq('.rowEven,.rowOdd'); |
||
44 | foreach ($tableRows as $tableRow) { |
||
45 | $tableRow = pq($tableRow)->remove('.spacer'); |
||
46 | $departureObject = new \stdClass(); |
||
47 | $departureObject->lineNumber = trim(pq($tableRow)->find('.lineColumn')->html()); |
||
48 | $departureObject->destination = trim(preg_replace("(<([a-z]+).*?>.*?</\\1>)is", "", pq($tableRow)->find('.stationColumn')->html())); |
||
49 | $departureObject->time = trim(pq($tableRow)->find('.inMinColumn')->html()); |
||
50 | $this->departureObjects[] = $departureObject; |
||
51 | |||
52 | } |
||
53 | |||
54 | //Time + Station name |
||
55 | $this->setStation(pq('.headerStationColumn')->html()); |
||
56 | $this->setCurrentTime(pq('.serverTimeColumn')->html()); |
||
57 | |||
58 | |||
59 | } |
||
60 | |||
61 | public function getDepartures() { |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getCurrentTime() { |
||
71 | |||
72 | /** |
||
73 | * @param string $currentTime |
||
74 | */ |
||
75 | protected function setCurrentTime($currentTime) { |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getStation() { |
||
85 | |||
86 | /** |
||
87 | * @param string $station |
||
88 | */ |
||
89 | protected function setStation($station) { |
||
92 | |||
93 | |||
94 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: