@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | class WriterFactory |
| 31 | 31 | { |
| 32 | - public $configFile = __DIR__ . '/../../config/callingallpapers.ini'; |
|
| 32 | + public $configFile = __DIR__.'/../../config/callingallpapers.ini'; |
|
| 33 | 33 | |
| 34 | 34 | public function getWriter() |
| 35 | 35 | { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | throw new UnknownWriterException('The requested writer could not be created'); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if (! $writer instanceof WriterInterface) { |
|
| 45 | + if (!$writer instanceof WriterInterface) { |
|
| 46 | 46 | throw new InvalidWriterException('The requested writer is not of the expected type'); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | |
| 64 | 64 | $values = json_decode($result->getBody()->getContents(), true); |
| 65 | 65 | |
| 66 | - if (! isset($values['status']) || $values['status'] !== 'OK') { |
|
| 66 | + if (!isset($values['status']) || $values['status'] !== 'OK') { |
|
| 67 | 67 | return 'UTC'; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -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']; |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | |
| 106 | 106 | public function addTag($tag) |
| 107 | 107 | { |
| 108 | - if (! in_array($tag, $this->tags)) { |
|
| 108 | + if (!in_array($tag, $this->tags)) { |
|
| 109 | 109 | $this->tags[] = $tag; |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -66,11 +66,11 @@ |
||
| 66 | 66 | |
| 67 | 67 | $start = new \DateTime($input->getOption('start')); |
| 68 | 68 | |
| 69 | - if (! $start instanceof \DateTime) { |
|
| 69 | + if (!$start instanceof \DateTime) { |
|
| 70 | 70 | throw new \InvalidArgumentException('The given date could not be parsed'); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $config = parse_ini_file(__DIR__ . '/../../config/callingallpapers.ini'); |
|
| 73 | + $config = parse_ini_file(__DIR__.'/../../config/callingallpapers.ini'); |
|
| 74 | 74 | $reader = new ApiCfpReader($config['event_api_url'], $config['event_api_token']); |
| 75 | 75 | $cfps = $reader->getCfpsEndingWithinInterval( |
| 76 | 76 | new \DateInterval('PT1H'), |
@@ -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 | |
@@ -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 | |
@@ -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; |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | try { |
| 66 | 66 | $uri = ''; |
| 67 | 67 | $this->client->get($cfp->conferenceUri, [ |
| 68 | - 'on_stats' => function (TransferStats $stats) use (&$uri) { |
|
| 68 | + 'on_stats' => function(TransferStats $stats) use (&$uri) { |
|
| 69 | 69 | $uri = (string) $stats->getEffectiveUri(); |
| 70 | 70 | } |
| 71 | 71 | ]); |
| 72 | 72 | } catch (\Exception $e) { |
| 73 | - throw new \InvalidArgumentException('Event-URI could not be verified: ' . $e->getMessage()); |
|
| 73 | + throw new \InvalidArgumentException('Event-URI could not be verified: '.$e->getMessage()); |
|
| 74 | 74 | } |
| 75 | 75 | $cfp->conferenceUri = $uri; |
| 76 | 76 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | try { |
| 99 | 99 | $this->client->request('GET', sprintf( |
| 100 | - $this->baseUri . '/%1$s', |
|
| 100 | + $this->baseUri.'/%1$s', |
|
| 101 | 101 | sha1($cfp->conferenceUri) |
| 102 | 102 | ), []); |
| 103 | 103 | $exists = true; |
@@ -112,18 +112,18 @@ discard block |
||
| 112 | 112 | $this->baseUri |
| 113 | 113 | ), [ |
| 114 | 114 | 'headers' => [ |
| 115 | - 'Authorization' => 'Bearer ' . $this->bearerToken, |
|
| 115 | + 'Authorization' => 'Bearer '.$this->bearerToken, |
|
| 116 | 116 | ], |
| 117 | 117 | 'form_params' => $body |
| 118 | 118 | ]); |
| 119 | 119 | } else { |
| 120 | 120 | // Exists, so update it |
| 121 | 121 | $response = $this->client->request('PUT', sprintf( |
| 122 | - $this->baseUri . '/%1$s', |
|
| 122 | + $this->baseUri.'/%1$s', |
|
| 123 | 123 | sha1($cfp->conferenceUri) |
| 124 | 124 | ), [ |
| 125 | 125 | 'headers' => [ |
| 126 | - 'Authorization' => 'Bearer ' . $this->bearerToken, |
|
| 126 | + 'Authorization' => 'Bearer '.$this->bearerToken, |
|
| 127 | 127 | ], |
| 128 | 128 | 'form_params' => $body |
| 129 | 129 | ]); |
@@ -139,10 +139,10 @@ discard block |
||
| 139 | 139 | $this->output->writeln(sprintf( |
| 140 | 140 | 'Conference "%1$s" succcessfully %2$s.', |
| 141 | 141 | $cfp->conferenceName, |
| 142 | - ($exists)?'updated':'created' |
|
| 142 | + ($exists) ? 'updated' : 'created' |
|
| 143 | 143 | )); |
| 144 | 144 | |
| 145 | - return (isset($response) && ($response->getStatusCode() === 200 || $response->getStatusCode() === 201))?'Success':'Failure'; |
|
| 145 | + return (isset($response) && ($response->getStatusCode() === 200 || $response->getStatusCode() === 201)) ? 'Success' : 'Failure'; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | public function setOutput(OutputInterface $output) |