@@ -32,6 +32,10 @@ |
||
| 32 | 32 | class Description |
| 33 | 33 | { |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param \DOMDocument $dom |
|
| 37 | + * @param \DOMXPath $xpath |
|
| 38 | + */ |
|
| 35 | 39 | public function parse($dom, $xpath) |
| 36 | 40 | { |
| 37 | 41 | $result = $xpath->query('//div[contains(@class, "description")]'); |
@@ -150,6 +150,9 @@ |
||
| 150 | 150 | return [$location->lat, $location->lon]; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | + /** |
|
| 154 | + * @param \DOMXPath $xpath |
|
| 155 | + */ |
|
| 153 | 156 | public function getEventPage($xpath) |
| 154 | 157 | { |
| 155 | 158 | $confPath = $xpath->query("//h3/a[contains(@class, 'summary')]"); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $content = file_Get_contents($uri); |
| 58 | 58 | $content = mb_convert_encoding($content, 'UTF-8'); |
| 59 | - $dom->loadHTML('<?xml version="1.0" charset="UTF-8" ?>' . $content); |
|
| 59 | + $dom->loadHTML('<?xml version="1.0" charset="UTF-8" ?>'.$content); |
|
| 60 | 60 | $dom->preserveWhiteSpace = false; |
| 61 | 61 | |
| 62 | 62 | $timezone = 'UTC'; |
@@ -154,15 +154,15 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | $confPath = $xpath->query("//h3/a[contains(@class, 'summary')]"); |
| 156 | 156 | |
| 157 | - if (! $confPath || $confPath->length == 0) { |
|
| 157 | + if (!$confPath || $confPath->length == 0) { |
|
| 158 | 158 | throw new \InvalidArgumentException('We can\'t find an EventPage'); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | $dom = new \DOMDocument('1.0', 'UTF-8'); |
| 162 | 162 | |
| 163 | - $content = file_get_contents('https://lanyrd.com' . $confPath->item(0)->attributes->getNamedItem('href')->textContent); |
|
| 163 | + $content = file_get_contents('https://lanyrd.com'.$confPath->item(0)->attributes->getNamedItem('href')->textContent); |
|
| 164 | 164 | $content = mb_convert_encoding($content, 'UTF-8'); |
| 165 | - $dom->loadHTML('<?xml version="1.0" charset="UTF-8" ?>' . $content); |
|
| 165 | + $dom->loadHTML('<?xml version="1.0" charset="UTF-8" ?>'.$content); |
|
| 166 | 166 | $dom->preserveWhiteSpace = false; |
| 167 | 167 | |
| 168 | 168 | return $dom; |
@@ -38,6 +38,10 @@ |
||
| 38 | 38 | $this->timezone = new \DateTimezone($timezone); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param \DOMDocument $dom |
|
| 43 | + * @param \DOMXPath $xpath |
|
| 44 | + */ |
|
| 41 | 45 | public function parse($dom, $xpath) |
| 42 | 46 | { |
| 43 | 47 | $endDate = $xpath->query("//div[contains(@class, 'vevent')]/*/abbr[contains(@class, 'dtend')]"); ///a/abbr[class='dtstart'] |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | public function parse($dom, $xpath) |
| 36 | 36 | { |
| 37 | 37 | $endDate = $xpath->query("//div[contains(@class, 'vevent')]/*/abbr[contains(@class, 'dtend')]"); ///a/abbr[class='dtstart'] |
| 38 | - if (! $endDate || $endDate->length == 0) { |
|
| 38 | + if (!$endDate || $endDate->length == 0) { |
|
| 39 | 39 | throw new \InvalidArgumentException('The Event does not seem to have an end date'); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -32,6 +32,10 @@ |
||
| 32 | 32 | class EventName |
| 33 | 33 | { |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param \DOMDocument $dom |
|
| 37 | + * @param \DOMXPath $xpath |
|
| 38 | + */ |
|
| 35 | 39 | public function parse($dom, $xpath) |
| 36 | 40 | { |
| 37 | 41 | $confPath = $xpath->query("//h3/a[contains(@class, 'summary')]"); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | $confPath = $xpath->query("//h3/a[contains(@class, 'summary')]"); |
| 38 | 38 | |
| 39 | - if (! $confPath || $confPath->length == 0) { |
|
| 39 | + if (!$confPath || $confPath->length == 0) { |
|
| 40 | 40 | throw new \InvalidArgumentException('The CfP does not seem to have an eventname'); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -38,6 +38,10 @@ |
||
| 38 | 38 | $this->timezone = new \DateTimezone($timezone); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param \DOMDocument $dom |
|
| 43 | + * @param \DOMXPath $xpath |
|
| 44 | + */ |
|
| 41 | 45 | public function parse($dom, $xpath) |
| 42 | 46 | { |
| 43 | 47 | $startDate = $xpath->query("//div[contains(@class, 'vevent')]/*/abbr[contains(@class, 'dtstart')]"); ///a/abbr[class='dtstart'] |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | public function parse($dom, $xpath) |
| 36 | 36 | { |
| 37 | 37 | $startDate = $xpath->query("//div[contains(@class, 'vevent')]/*/abbr[contains(@class, 'dtstart')]"); ///a/abbr[class='dtstart'] |
| 38 | - if (! $startDate || $startDate->length == 0) { |
|
| 38 | + if (!$startDate || $startDate->length == 0) { |
|
| 39 | 39 | throw new \InvalidArgumentException('The Event does not seem to have a start date'); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -32,6 +32,10 @@ |
||
| 32 | 32 | class EventUri |
| 33 | 33 | { |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param \DOMDocument $dom |
|
| 37 | + * @param \DOMXPath $xpath |
|
| 38 | + */ |
|
| 35 | 39 | public function parse($dom, $xpath) |
| 36 | 40 | { |
| 37 | 41 | $uriPath = $xpath->query("//a[contains(@title, 'visit their website')]"); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | $uriPath = $xpath->query("//a[contains(@title, 'visit their website')]"); |
| 38 | 38 | |
| 39 | - if (! $uriPath || $uriPath->length == 0) { |
|
| 39 | + if (!$uriPath || $uriPath->length == 0) { |
|
| 40 | 40 | throw new \InvalidArgumentException('The CfP does not seem to have an EventUri'); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -32,6 +32,10 @@ |
||
| 32 | 32 | class Location |
| 33 | 33 | { |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param \DOMDocument $dom |
|
| 37 | + * @param \DOMXPath $xpath |
|
| 38 | + */ |
|
| 35 | 39 | public function parse($dom, $xpath) |
| 36 | 40 | { |
| 37 | 41 | $locations = $xpath->query("//div[contains(@class, 'vevent')]/p[contains(@class, 'location')]/a"); ///a/abbr[class='dtstart'] |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | public function parse($dom, $xpath) |
| 36 | 36 | { |
| 37 | 37 | $locations = $xpath->query("//div[contains(@class, 'vevent')]/p[contains(@class, 'location')]/a"); ///a/abbr[class='dtstart'] |
| 38 | - if (! $locations || $locations->length == 0) { |
|
| 38 | + if (!$locations || $locations->length == 0) { |
|
| 39 | 39 | throw new \InvalidArgumentException('The Event does not seem to have an end date'); |
| 40 | 40 | } |
| 41 | 41 | $location = []; |
@@ -38,6 +38,10 @@ |
||
| 38 | 38 | $this->timezone = new \DateTimezone($timezone); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param \DOMDocument $dom |
|
| 43 | + * @param \DOMXPath $xpath |
|
| 44 | + */ |
|
| 41 | 45 | public function parse($dom, $xpath) |
| 42 | 46 | { |
| 43 | 47 | $openingDate = $xpath->query("//span[text()='Openend on:']/following-sibling::strong"); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | public function parse($dom, $xpath) |
| 42 | 42 | { |
| 43 | 43 | $openingDate = $xpath->query("//span[text()='Openend on:']/following-sibling::strong"); |
| 44 | - if (! $openingDate || $openingDate->length == 0) { |
|
| 44 | + if (!$openingDate || $openingDate->length == 0) { |
|
| 45 | 45 | throw new \UnexpectedValueException('No CfP-Open Date found'); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -32,6 +32,10 @@ |
||
| 32 | 32 | class Tags |
| 33 | 33 | { |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param \DOMDocument $dom |
|
| 37 | + * @param \DOMXPath $xpath |
|
| 38 | + */ |
|
| 35 | 39 | public function parse($dom, $xpath) |
| 36 | 40 | { |
| 37 | 41 | $tags = $xpath->query( |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $tags = $xpath->query( |
| 38 | 38 | "//ul[contains(@class, \"tags\")]/li/a" |
| 39 | 39 | ); |
| 40 | - if (! $tags || $tags->length == 0) { |
|
| 40 | + if (!$tags || $tags->length == 0) { |
|
| 41 | 41 | throw new \InvalidArgumentException('The CfP does not seem to have tags'); |
| 42 | 42 | } |
| 43 | 43 | |