Completed
Pull Request — master (#8)
by Andreas
02:20
created
config/dependencies.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
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());
Please login to merge, or discard this patch.
src/Renderer/IcalendarRenderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
                 'DTSTAMP' => $lastChange,
65 65
                 'UID'     => $cfp['_rel']['cfp_uri'],
66 66
                 'DESCRIPTION' => $cfp['description'],
67
-                'GEO'     => round($cfp['latitude'], 6) . ';' . round($cfp['longitude'], 6),
67
+                'GEO'     => round($cfp['latitude'], 6).';'.round($cfp['longitude'], 6),
68 68
                 'LOCATION' => $cfp['location'],
69 69
 
70 70
             ]);
Please login to merge, or discard this patch.
src/Service/CfpFactory.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
         }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
     public static function setName(Cfp $cfp, array $array)
83 83
     {
84
-        if (! isset($array['name'])) {
84
+        if (!isset($array['name'])) {
85 85
             throw new \InvalidArgumentException('Name has to be specified');
86 86
         }
87 87
         $cfp->setName(filter_var($array['name'], FILTER_SANITIZE_STRING));
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
     public static function setDateCfpStart(Cfp $cfp, array $array)
91 91
     {
92
-        if (! isset($array['dateCfpStart'])) {
92
+        if (!isset($array['dateCfpStart'])) {
93 93
             throw new \InvalidArgumentException('CFP-StartDate has to be specified');
94 94
         }
95 95
         $cfp->setDateCfpStart(new DateTimeImmutable($array['dateCfpStart']));
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
     public static function setDateCfpEnd(Cfp $cfp, array $array)
99 99
     {
100
-        if (! isset($array['dateCfpEnd'])) {
100
+        if (!isset($array['dateCfpEnd'])) {
101 101
             throw new \InvalidArgumentException('CFP-EndDate has to be specified');
102 102
         }
103 103
         $cfp->setDateCfpEnd(new DateTimeImmutable($array['dateCfpEnd']));
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
     public static function setTimezone(Cfp $cfp, array $array)
107 107
     {
108
-        if (! isset($array['timezone'])) {
108
+        if (!isset($array['timezone'])) {
109 109
             throw new \InvalidArgumentException('Timezone has to be specified');
110 110
         }
111 111
         $cfp->setTimezone(filter_var($array['timezone'], FILTER_SANITIZE_STRING));
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
     public static function setUri(Cfp $cfp, array $array)
115 115
     {
116
-        if (! isset($array['uri'])) {
116
+        if (!isset($array['uri'])) {
117 117
             throw new \InvalidArgumentException('URI has to be specified');
118 118
         }
119 119
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
     public static function setEventUri(Cfp $cfp, array $array)
124 124
     {
125
-        if (! isset($array['eventUri'])) {
125
+        if (!isset($array['eventUri'])) {
126 126
             throw new \InvalidArgumentException('Event-URI has to be specified');
127 127
         }
128 128
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
     public static function setIconUri(Cfp $cfp, array $array)
151 151
     {
152
-        if (! isset($array['iconUri'])) {
152
+        if (!isset($array['iconUri'])) {
153 153
             return;
154 154
         }
155 155
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
     public static function setDescription(Cfp $cfp, array $array)
160 160
     {
161
-        if (! isset($array['description'])) {
161
+        if (!isset($array['description'])) {
162 162
             return;
163 163
         }
164 164
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
     public static function setLocation(Cfp $cfp, array $array)
169 169
     {
170
-        if (! isset($array['location'])) {
170
+        if (!isset($array['location'])) {
171 171
             return;
172 172
         }
173 173
 
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
 
177 177
     public static function setGeolocation(Cfp $cfp, array $array)
178 178
     {
179
-        if (! isset($array['latitude'])) {
179
+        if (!isset($array['latitude'])) {
180 180
             return;
181 181
         }
182 182
 
183
-        if (! isset($array['longitude'])) {
183
+        if (!isset($array['longitude'])) {
184 184
             return;
185 185
         }
186 186
 
@@ -213,11 +213,11 @@  discard block
 block discarded – undo
213 213
 
214 214
     public static function setTags(Cfp $cfp, array $array)
215 215
     {
216
-        if (! isset($array['tags'])) {
216
+        if (!isset($array['tags'])) {
217 217
             return;
218 218
         }
219 219
 
220
-        $cfp->setTags(array_map(function ($item) {
220
+        $cfp->setTags(array_map(function($item) {
221 221
             return filter_var($item, FILTER_SANITIZE_STRING);
222 222
         }, $array['tags']));
223 223
     }
Please login to merge, or discard this patch.
src/Entity/Cfp.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@
 block discarded – undo
241 241
 
242 242
     public function setTimezone($timezone)
243 243
     {
244
-        if (! $timezone instanceof \DateTimeZone) {
244
+        if (!$timezone instanceof \DateTimeZone) {
245 245
             $timezone = new \DateTimeZone($timezone);
246 246
         }
247 247
 
Please login to merge, or discard this patch.
src/Entity/CfpListMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Entity/CfpList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/PersistenceLayer/CfpPersistenceLayer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                 $cfp->getEventUri()
55 55
             ), 400);
56 56
         }
57
-        $statement = 'INSERT into `cfp`(`dateCfpStart`, `dateCfpEnd`, `dateEventStart`, `dateEventEnd`, `name`, `uri`, `hash`, `timezone`, `description`, `eventUri`, `iconUri`, `latitude`, `longitude`, `location`, `tags`, `lastUpdate`) ' .
57
+        $statement = 'INSERT into `cfp`(`dateCfpStart`, `dateCfpEnd`, `dateEventStart`, `dateEventEnd`, `name`, `uri`, `hash`, `timezone`, `description`, `eventUri`, `iconUri`, `latitude`, `longitude`, `location`, `tags`, `lastUpdate`) '.
58 58
                      'VALUES (:dateCfpStart, :dateCfpEnd, :dateEventStart, :dateEventEnd, :name, :uri, :hash, :timezone, :description, :eventUri, :iconUri, :latitude, :longitude, :location, :tags, :lastUpdate);';
59 59
         $statement = $this->pdo->prepare($statement);
60 60
 
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
             return $values['hash'];
83 83
         }
84 84
 
85
-        throw new \UnexpectedValueException('The CfP could not be stored' . $statement->er, 400);
85
+        throw new \UnexpectedValueException('The CfP could not be stored'.$statement->er, 400);
86 86
     }
87 87
 
88 88
     public function update(Cfp $cfp, $fetchHash)
89 89
     {
90
-        if (! $fetchHash) {
90
+        if (!$fetchHash) {
91 91
             throw new \UnexpectedValueException('No Hash given', 400);
92 92
         }
93 93
         $oldValues = $this->select($fetchHash);
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
         ];
117 117
 
118 118
         foreach ($options as $option) {
119
-            $method = 'get' . $option;
119
+            $method = 'get'.$option;
120 120
             if ($cfp->$method() != $oldValues->$method()) {
121
-                $statementElements[] = '`' . $option . '` = :' . $option;
121
+                $statementElements[] = '`'.$option.'` = :'.$option;
122 122
                 $values[$option]     = $cfp->$method();
123 123
                 if ($values[$option] instanceof \DateTimeInterface) {
124 124
                     $values[$option] = $values[$option]->format('c');
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         }
136 136
 
137 137
         $statement = 'UPDATE `cfp` SET '
138
-                   . implode(',', $statementElements) . ','
138
+                   . implode(',', $statementElements).','
139 139
                    . '`lastUpdate` = :lastUpdate '
140 140
                    . 'WHERE `hash` = :fetchHash';
141 141
         $statement = $this->pdo->prepare($statement);
Please login to merge, or discard this patch.
src/Middleware/OAuth.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Middleware/Renderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
         switch ($accept[0]) {
61 61
             case 'text/html':
62 62
                 $container = $this->app->getContainer();
63
-                $container['view'] = function ($container) {
63
+                $container['view'] = function($container) {
64 64
                     $config = $container['settings'];
65 65
                     $tView  = new \Slim\Views\Twig($config['renderer']['template_path'],
66 66
                         [
Please login to merge, or discard this patch.