@@ -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 |
@@ -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']; |
@@ -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 |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | try { |
86 | 86 | $this->client->request('GET', sprintf( |
87 | - $this->baseUri . '/%1$s', |
|
87 | + $this->baseUri.'/%1$s', |
|
88 | 88 | sha1($cfp->conferenceUri) |
89 | 89 | ), []); |
90 | 90 | $exists = true; |
@@ -99,18 +99,18 @@ discard block |
||
99 | 99 | $this->baseUri |
100 | 100 | ), [ |
101 | 101 | 'headers' => [ |
102 | - 'Authorization' => 'Bearer ' . $this->bearerToken, |
|
102 | + 'Authorization' => 'Bearer '.$this->bearerToken, |
|
103 | 103 | ], |
104 | 104 | 'form_params' => $body |
105 | 105 | ]); |
106 | 106 | } else { |
107 | 107 | // Exists, so update it |
108 | 108 | $response = $this->client->request('PUT', sprintf( |
109 | - $this->baseUri . '/%1$s', |
|
109 | + $this->baseUri.'/%1$s', |
|
110 | 110 | sha1($cfp->conferenceUri) |
111 | 111 | ), [ |
112 | 112 | 'headers' => [ |
113 | - 'Authorization' => 'Bearer ' . $this->bearerToken, |
|
113 | + 'Authorization' => 'Bearer '.$this->bearerToken, |
|
114 | 114 | ], |
115 | 115 | 'form_params' => $body |
116 | 116 | ]); |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | $this->output->writeln(sprintf( |
127 | 127 | 'Conference "%1$s" succcessfully %2$s.', |
128 | 128 | $cfp->conferenceName, |
129 | - ($exists)?'updated':'created' |
|
129 | + ($exists) ? 'updated' : 'created' |
|
130 | 130 | )); |
131 | 131 | |
132 | - return (isset($response) && ($response->getStatusCode() === 200 || $response->getStatusCode() === 201))?'Success':'Failure'; |
|
132 | + return (isset($response) && ($response->getStatusCode() === 200 || $response->getStatusCode() === 201)) ? 'Success' : 'Failure'; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | public function setOutput(OutputInterface $output) |