@@ -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 | { |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | protected function configure() |
| 43 | 43 | { |
| 44 | 44 | $this->setName("parseCfPs") |
| 45 | - ->setDescription("Retrieve CfPs and parse them") |
|
| 46 | - ->setDefinition(array( |
|
| 47 | - new InputOption('start', 's', InputOption::VALUE_OPTIONAL, 'What should be the first date to be taken into account?', ''), |
|
| 48 | - )) |
|
| 49 | - ->setHelp(<<<EOT |
|
| 45 | + ->setDescription("Retrieve CfPs and parse them") |
|
| 46 | + ->setDefinition(array( |
|
| 47 | + new InputOption('start', 's', InputOption::VALUE_OPTIONAL, 'What should be the first date to be taken into account?', ''), |
|
| 48 | + )) |
|
| 49 | + ->setHelp(<<<EOT |
|
| 50 | 50 | Get details about CfPs from different sources |
| 51 | 51 | |
| 52 | 52 | Usage: |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | If you ommit the date the current date will be used instead |
| 57 | 57 | <info>callingallpapers parseCfPs<env></info> |
| 58 | 58 | EOT |
| 59 | - ); |
|
| 59 | + ); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | protected function execute(InputInterface $input, OutputInterface $output) |
@@ -67,11 +67,11 @@ |
||
| 67 | 67 | |
| 68 | 68 | $start = new \DateTime($input->getOption('start')); |
| 69 | 69 | |
| 70 | - if (! $start instanceof \DateTime) { |
|
| 70 | + if (!$start instanceof \DateTime) { |
|
| 71 | 71 | throw new \InvalidArgumentException('The given date could not be parsed'); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $config = parse_ini_file(__DIR__ . '/../../config/callingallpapers.ini'); |
|
| 74 | + $config = parse_ini_file(__DIR__.'/../../config/callingallpapers.ini'); |
|
| 75 | 75 | $writer = new ApiCfpWriter($config['event_api_url'], $config['event_api_token']); |
| 76 | 76 | $writer->setOutput($output); |
| 77 | 77 | |
@@ -30,7 +30,6 @@ |
||
| 30 | 30 | namespace Callingallpapers\Parser\Lanyrd; |
| 31 | 31 | |
| 32 | 32 | use Callingallpapers\Entity\Cfp; |
| 33 | -use Callingallpapers\Parser\Lanyrd\LanyrdEntryParser; |
|
| 34 | 33 | use Callingallpapers\Parser\ParserInterface; |
| 35 | 34 | use Callingallpapers\Writer\WriterInterface; |
| 36 | 35 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | do { |
| 48 | 48 | $dom = new \DOMDocument('1.0', 'UTF-8'); |
| 49 | - $dom->loadHTMLFile($uri . '?page=' . ($i+1)); |
|
| 49 | + $dom->loadHTMLFile($uri.'?page='.($i + 1)); |
|
| 50 | 50 | $dom->preserveWhiteSpace = false; |
| 51 | 51 | |
| 52 | 52 | $xpath = new \DOMXPath($dom); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $eventPageUrl = $links->item(0)->attributes->getNamedItem('href')->textContent; |
| 79 | 79 | error_log($eventPageUrl); |
| 80 | - if (! $eventPageUrl) { |
|
| 80 | + if (!$eventPageUrl) { |
|
| 81 | 81 | continue; |
| 82 | 82 | } |
| 83 | 83 | $writer->write($lanyrdEntryParser->parse($eventPageUrl), 'lanyrd.com'); |
@@ -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 | "//div[contains(@class, \"description\")]/following-sibling::p/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 | |
@@ -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 | $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( |
@@ -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 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( |
@@ -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 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( |
@@ -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 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( |