@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | /** |
| 145 | 145 | * Gets the decorated flag. |
| 146 | 146 | * |
| 147 | - * @return bool true if the output will decorate messages, false otherwise |
|
| 147 | + * @return integer true if the output will decorate messages, false otherwise |
|
| 148 | 148 | * @api |
| 149 | 149 | */ |
| 150 | 150 | public function isDecorated() |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | /** |
| 167 | 167 | * Returns whether verbosity is quiet (-q). |
| 168 | 168 | * |
| 169 | - * @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise |
|
| 169 | + * @return boolean|null true if verbosity is set to VERBOSITY_QUIET, false otherwise |
|
| 170 | 170 | */ |
| 171 | 171 | public function isQuiet() |
| 172 | 172 | { |
@@ -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 | |
@@ -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 = []; |
@@ -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 | |
@@ -32,6 +32,10 @@ |
||
| 32 | 32 | class Uri |
| 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 | $uri = $xpath->query( |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $uri = $xpath->query( |
| 38 | 38 | "//strong[contains(@class, \"call-open\")]/following-sibling::a" |
| 39 | 39 | ); |
| 40 | - if (! $uri || $uri->length == 0) { |
|
| 40 | + if (!$uri || $uri->length == 0) { |
|
| 41 | 41 | throw new \InvalidArgumentException('The CfP does not seem to have a CfP-Uri'); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | public function parse($dom, $xpath) |
| 36 | 36 | { |
| 37 | 37 | $closingDate = $xpath->query("//span[text()='Closes on:']/following-sibling::strong"); |
| 38 | - if (! $closingDate || $closingDate->length == 0) { |
|
| 38 | + if (!$closingDate || $closingDate->length == 0) { |
|
| 39 | 39 | throw new \InvalidArgumentException('The CfP does not seem to have a closing date'); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -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 | $closingDate = $xpath->query("//span[text()='Closes on:']/following-sibling::strong"); |
@@ -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 | |
@@ -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 | $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 | |
@@ -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'] |
@@ -114,6 +114,9 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | + /** |
|
| 118 | + * @param string $location |
|
| 119 | + */ |
|
| 117 | 120 | protected function getLatLonForLocation($location) |
| 118 | 121 | { |
| 119 | 122 | $result = $this->client->get(sprintf( |
@@ -131,6 +134,9 @@ discard block |
||
| 131 | 134 | return [$location->lat, $location->lon]; |
| 132 | 135 | } |
| 133 | 136 | |
| 137 | + /** |
|
| 138 | + * @param \DOMXPath $xpath |
|
| 139 | + */ |
|
| 134 | 140 | public function getEventPage($xpath) |
| 135 | 141 | { |
| 136 | 142 | $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'; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | { |
| 156 | 156 | $confPath = $xpath->query("//h3/a[contains(@class, 'summary')]"); |
| 157 | 157 | |
| 158 | - if (! $confPath || $confPath->length == 0) { |
|
| 158 | + if (!$confPath || $confPath->length == 0) { |
|
| 159 | 159 | throw new \InvalidArgumentException('We can\'t find an EventPage'); |
| 160 | 160 | } |
| 161 | 161 | |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | 'verify_peer_name' => false, |
| 168 | 168 | ] |
| 169 | 169 | ]); |
| 170 | - $content = file_get_contents('https://lanyrd.com' . $confPath->item(0)->attributes->getNamedItem('href')->textContent, false, $context); |
|
| 170 | + $content = file_get_contents('https://lanyrd.com'.$confPath->item(0)->attributes->getNamedItem('href')->textContent, false, $context); |
|
| 171 | 171 | $content = mb_convert_encoding($content, 'UTF-8'); |
| 172 | - $dom->loadHTML('<?xml version="1.0" charset="UTF-8" ?>' . $content); |
|
| 172 | + $dom->loadHTML('<?xml version="1.0" charset="UTF-8" ?>'.$content); |
|
| 173 | 173 | $dom->preserveWhiteSpace = false; |
| 174 | 174 | |
| 175 | 175 | return $dom; |