@@ -4,13 +4,13 @@ |
||
4 | 4 | $container = $app->getContainer(); |
5 | 5 | |
6 | 6 | // view renderer |
7 | -$container['renderer'] = function ($c) { |
|
7 | +$container['renderer'] = function($c) { |
|
8 | 8 | $settings = $c->get('settings')['renderer']; |
9 | 9 | return new Slim\Views\PhpRenderer($settings['template_path']); |
10 | 10 | }; |
11 | 11 | |
12 | 12 | // monolog |
13 | -$container['logger'] = function ($c) { |
|
13 | +$container['logger'] = function($c) { |
|
14 | 14 | $settings = $c->get('settings')['logger']; |
15 | 15 | $logger = new Monolog\Logger($settings['name']); |
16 | 16 | $logger->pushProcessor(new Monolog\Processor\UidProcessor()); |
@@ -52,7 +52,7 @@ |
||
52 | 52 | 'tags' => $cfp->getTags(), |
53 | 53 | 'lastChange' => $cfp->getLastUdated()->format('c'), |
54 | 54 | '_rel' => [ |
55 | - 'cfp_uri' => 'v1/cfp/' . $cfp->getHash(), |
|
55 | + 'cfp_uri' => 'v1/cfp/'.$cfp->getHash(), |
|
56 | 56 | ] |
57 | 57 | ]; |
58 | 58 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | public function add(Cfp $cfp) |
35 | 35 | { |
36 | - if (! $this->has($cfp)) { |
|
36 | + if (!$this->has($cfp)) { |
|
37 | 37 | $this->cfps[] = $cfp; |
38 | 38 | } |
39 | 39 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | $bearer = explode(' ', $auth[0]); |
71 | - if (! isset($bearer[1])) { |
|
71 | + if (!isset($bearer[1])) { |
|
72 | 72 | return $this->getNoAuthResponse($response); |
73 | 73 | } |
74 | 74 | $bearer = $bearer[1]; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | protected function getNoAuthResponse($response, $error = 'no token', $description = 'No Access-Token provided') |
89 | 89 | { |
90 | - $response = $response->withHeader('WWW-Authenticate', 'Bearer realm="callingallpapers", error="' . $error . '", error_desciption="' . $description . '"'); |
|
90 | + $response = $response->withHeader('WWW-Authenticate', 'Bearer realm="callingallpapers", error="'.$error.'", error_desciption="'.$description.'"'); |
|
91 | 91 | $response = $response->withStatus(401); |
92 | 92 | |
93 | 93 | return $response; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | if (strpos($accept[0], 'text/html') !== false) { |
61 | 61 | $container = $this->app->getContainer(); |
62 | - $container['view'] = function ($container) { |
|
62 | + $container['view'] = function($container) { |
|
63 | 63 | $config = $container['settings']; |
64 | 64 | $tView = new \Slim\Views\Twig($config['renderer']['template_path'], |
65 | 65 | [ |
@@ -56,7 +56,7 @@ |
||
56 | 56 | 'uri' => 'http://andreas.heigl.org', |
57 | 57 | ]); |
58 | 58 | $feed->setDateModified(time()); |
59 | - if (! isset($data['cfps'])) { |
|
59 | + if (!isset($data['cfps'])) { |
|
60 | 60 | $data['cfps'] = []; |
61 | 61 | } |
62 | 62 | foreach ($data['cfps'] as $cfp) { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function render(ResponseInterface $response, array $data = [], $status = 200) |
46 | 46 | { |
47 | 47 | $icalendar = new VCalendar(); |
48 | - if (! isset($data['cfps'])) { |
|
48 | + if (!isset($data['cfps'])) { |
|
49 | 49 | $data['cfps'] = []; |
50 | 50 | } |
51 | 51 | foreach ($data['cfps'] as $cfp) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'DTSTAMP' => $lastChange, |
67 | 67 | 'UID' => $cfp['_rel']['cfp_uri'], |
68 | 68 | 'DESCRIPTION' => $cfp['description'], |
69 | - 'GEO' => round($cfp['latitude'], 6) . ';' . round($cfp['longitude'], 6), |
|
69 | + 'GEO' => round($cfp['latitude'], 6).';'.round($cfp['longitude'], 6), |
|
70 | 70 | 'LOCATION' => $cfp['location'], |
71 | 71 | |
72 | 72 | ]); |
@@ -27,22 +27,22 @@ |
||
27 | 27 | * @since 15.01.2016 |
28 | 28 | * @link http://github.com/heiglandreas/callingallpapers |
29 | 29 | */ |
30 | -require_once realpath(__DIR__ . '/../vendor/autoload.php'); |
|
30 | +require_once realpath(__DIR__.'/../vendor/autoload.php'); |
|
31 | 31 | |
32 | 32 | session_start(); |
33 | 33 | |
34 | 34 | // Instantiate the app |
35 | -$settings = require __DIR__ . '/../config/settings.php'; |
|
35 | +$settings = require __DIR__.'/../config/settings.php'; |
|
36 | 36 | $app = new \Slim\App($settings); |
37 | 37 | |
38 | 38 | // Set up dependencies |
39 | -require __DIR__ . '/../config/dependencies.php'; |
|
39 | +require __DIR__.'/../config/dependencies.php'; |
|
40 | 40 | |
41 | 41 | // Register middleware |
42 | -require __DIR__ . '/../config/middleware.php'; |
|
42 | +require __DIR__.'/../config/middleware.php'; |
|
43 | 43 | |
44 | 44 | // Register routes |
45 | -require __DIR__ . '/../config/routes.php'; |
|
45 | +require __DIR__.'/../config/routes.php'; |
|
46 | 46 | |
47 | 47 | // Run app |
48 | 48 | $app->run(); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $missingFields = []; |
50 | 50 | |
51 | 51 | foreach ($requiredFields as $field) { |
52 | - if (! isset($params[$field])) { |
|
52 | + if (!isset($params[$field])) { |
|
53 | 53 | $missingFields[] = $field; |
54 | 54 | } |
55 | 55 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | public static function setName(Cfp $cfp, array $array) |
84 | 84 | { |
85 | - if (! isset($array['name'])) { |
|
85 | + if (!isset($array['name'])) { |
|
86 | 86 | throw new \InvalidArgumentException('Name has to be specified'); |
87 | 87 | } |
88 | 88 | $cfp->setName(filter_var($array['name'], FILTER_SANITIZE_STRING)); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | public static function setDateCfpStart(Cfp $cfp, array $array) |
92 | 92 | { |
93 | - if (! isset($array['dateCfpStart'])) { |
|
93 | + if (!isset($array['dateCfpStart'])) { |
|
94 | 94 | throw new \InvalidArgumentException('CFP-StartDate has to be specified'); |
95 | 95 | } |
96 | 96 | $cfp->setDateCfpStart(new DateTimeImmutable($array['dateCfpStart'])); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | public static function setDateCfpEnd(Cfp $cfp, array $array) |
100 | 100 | { |
101 | - if (! isset($array['dateCfpEnd'])) { |
|
101 | + if (!isset($array['dateCfpEnd'])) { |
|
102 | 102 | throw new \InvalidArgumentException('CFP-EndDate has to be specified'); |
103 | 103 | } |
104 | 104 | $cfp->setDateCfpEnd(new DateTimeImmutable($array['dateCfpEnd'])); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | public static function setTimezone(Cfp $cfp, array $array) |
108 | 108 | { |
109 | - if (! isset($array['timezone'])) { |
|
109 | + if (!isset($array['timezone'])) { |
|
110 | 110 | throw new \InvalidArgumentException('Timezone has to be specified'); |
111 | 111 | } |
112 | 112 | $cfp->setTimezone(filter_var($array['timezone'], FILTER_SANITIZE_STRING)); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | public static function setUri(Cfp $cfp, array $array) |
116 | 116 | { |
117 | - if (! isset($array['uri'])) { |
|
117 | + if (!isset($array['uri'])) { |
|
118 | 118 | throw new \InvalidArgumentException('URI has to be specified'); |
119 | 119 | } |
120 | 120 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | public static function setEventUri(Cfp $cfp, array $array) |
125 | 125 | { |
126 | - if (! isset($array['eventUri'])) { |
|
126 | + if (!isset($array['eventUri'])) { |
|
127 | 127 | throw new \InvalidArgumentException('Event-URI has to be specified'); |
128 | 128 | } |
129 | 129 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | public static function setIconUri(Cfp $cfp, array $array) |
152 | 152 | { |
153 | - if (! isset($array['iconUri'])) { |
|
153 | + if (!isset($array['iconUri'])) { |
|
154 | 154 | return; |
155 | 155 | } |
156 | 156 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | public static function setDescription(Cfp $cfp, array $array) |
161 | 161 | { |
162 | - if (! isset($array['description'])) { |
|
162 | + if (!isset($array['description'])) { |
|
163 | 163 | return; |
164 | 164 | } |
165 | 165 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | public static function setLocation(Cfp $cfp, array $array) |
170 | 170 | { |
171 | - if (! isset($array['location'])) { |
|
171 | + if (!isset($array['location'])) { |
|
172 | 172 | return; |
173 | 173 | } |
174 | 174 | |
@@ -177,11 +177,11 @@ discard block |
||
177 | 177 | |
178 | 178 | public static function setGeolocation(Cfp $cfp, array $array) |
179 | 179 | { |
180 | - if (! isset($array['latitude'])) { |
|
180 | + if (!isset($array['latitude'])) { |
|
181 | 181 | return; |
182 | 182 | } |
183 | 183 | |
184 | - if (! isset($array['longitude'])) { |
|
184 | + if (!isset($array['longitude'])) { |
|
185 | 185 | return; |
186 | 186 | } |
187 | 187 | |
@@ -214,18 +214,18 @@ discard block |
||
214 | 214 | |
215 | 215 | public static function setTags(Cfp $cfp, array $array) |
216 | 216 | { |
217 | - if (! isset($array['tags'])) { |
|
217 | + if (!isset($array['tags'])) { |
|
218 | 218 | return; |
219 | 219 | } |
220 | 220 | |
221 | - $cfp->setTags(array_map(function ($item) { |
|
221 | + $cfp->setTags(array_map(function($item) { |
|
222 | 222 | return filter_var($item, FILTER_SANITIZE_STRING); |
223 | 223 | }, $array['tags'])); |
224 | 224 | } |
225 | 225 | |
226 | 226 | public static function setSource(Cfp $cfp, array $array) |
227 | 227 | { |
228 | - if (! isset($array['source'])) { |
|
228 | + if (!isset($array['source'])) { |
|
229 | 229 | return; |
230 | 230 | } |
231 | 231 |