@@ -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'; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $openingDateParser = new OpeningDate($timezone); |
| 89 | 89 | try { |
| 90 | 90 | $cfp->dateStart = $openingDateParser->parse($dom, $xpath); |
| 91 | - } catch (\Exception $e){} |
|
| 91 | + } catch (\Exception $e) {} |
|
| 92 | 92 | |
| 93 | 93 | $cfpUriParser = new Uri(); |
| 94 | 94 | $cfp->uri = $cfpUriParser->parse($dom, $xpath); |
@@ -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; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $uri |
| 51 | 51 | ); |
| 52 | 52 | $request = new Request('POST', |
| 53 | - 'statuses/update.json?' . $this->formUrlEncode([ |
|
| 53 | + 'statuses/update.json?'.$this->formUrlEncode([ |
|
| 54 | 54 | 'status' => $notificationString, |
| 55 | 55 | 'lat' => $cfp->latitude, |
| 56 | 56 | 'long' => $cfp->longitude, |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | if (strlen($name) < 70) { |
| 71 | 71 | return $name; |
| 72 | 72 | } |
| 73 | - return substr($name, 0, 69) . '…'; |
|
| 73 | + return substr($name, 0, 69).'…'; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | protected function shortenUri($uri) |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | return $list; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - if (! $items) { |
|
| 95 | + if (!$items) { |
|
| 96 | 96 | return $list; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $cfp->longitude = $item['longitude']; |
| 111 | 111 | $cfp->iconUri = $item['iconUri']; |
| 112 | 112 | $cfp->uri = $item['uri']; |
| 113 | - $cfp->tags = array_filter($item['tags'], function ($item) { |
|
| 113 | + $cfp->tags = array_filter($item['tags'], function($item) { |
|
| 114 | 114 | return (bool) $item; |
| 115 | 115 | }); |
| 116 | 116 | $cfp->timezone = $item['timezone']; |
@@ -45,18 +45,18 @@ |
||
| 45 | 45 | protected function configure() |
| 46 | 46 | { |
| 47 | 47 | $this->setName("notifyClosingCfps") |
| 48 | - ->setDescription("Notify about CfPs that close within 24 hours") |
|
| 49 | - ->setDefinition(array( |
|
| 50 | - new InputOption('start', 's', InputOption::VALUE_OPTIONAL, 'What should be the first date to be taken into account?', ''), |
|
| 51 | - )) |
|
| 52 | - ->setHelp(<<<EOT |
|
| 48 | + ->setDescription("Notify about CfPs that close within 24 hours") |
|
| 49 | + ->setDefinition(array( |
|
| 50 | + new InputOption('start', 's', InputOption::VALUE_OPTIONAL, 'What should be the first date to be taken into account?', ''), |
|
| 51 | + )) |
|
| 52 | + ->setHelp(<<<EOT |
|
| 53 | 53 | Notify about CfPs that are closing within 24 hours |
| 54 | 54 | |
| 55 | 55 | Usage: |
| 56 | 56 | |
| 57 | 57 | <info>callingallpapers notifyClosingCfp</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 | |