@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $missingFields = []; |
| 52 | 52 | |
| 53 | 53 | foreach ($requiredFields as $field) { |
| 54 | - if (! isset($params[$field])) { |
|
| 54 | + if (!isset($params[$field])) { |
|
| 55 | 55 | $missingFields[] = $field; |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | public static function setName(Cfp $cfp, array $array) |
| 86 | 86 | { |
| 87 | - if (! isset($array['name'])) { |
|
| 87 | + if (!isset($array['name'])) { |
|
| 88 | 88 | throw new \InvalidArgumentException('Name has to be specified'); |
| 89 | 89 | } |
| 90 | 90 | $cfp->setName(filter_var($array['name'], FILTER_SANITIZE_STRING)); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public static function setDateCfpStart(Cfp $cfp, array $array) |
| 94 | 94 | { |
| 95 | - if (! isset($array['dateCfpStart'])) { |
|
| 95 | + if (!isset($array['dateCfpStart'])) { |
|
| 96 | 96 | $array['dateCfpStart'] = '@0'; |
| 97 | 97 | } |
| 98 | 98 | $cfp->setDateCfpStart(new DateTimeImmutable($array['dateCfpStart'])); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | public static function setDateCfpEnd(Cfp $cfp, array $array) |
| 102 | 102 | { |
| 103 | - if (! isset($array['dateCfpEnd'])) { |
|
| 103 | + if (!isset($array['dateCfpEnd'])) { |
|
| 104 | 104 | throw new \InvalidArgumentException('CFP-EndDate has to be specified'); |
| 105 | 105 | } |
| 106 | 106 | $cfp->setDateCfpEnd(new DateTimeImmutable($array['dateCfpEnd'])); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | public static function setTimezone(Cfp $cfp, array $array) |
| 110 | 110 | { |
| 111 | - if (! isset($array['timezone'])) { |
|
| 111 | + if (!isset($array['timezone'])) { |
|
| 112 | 112 | throw new \InvalidArgumentException('Timezone has to be specified'); |
| 113 | 113 | } |
| 114 | 114 | $cfp->setTimezone(filter_var($array['timezone'], FILTER_SANITIZE_STRING)); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | public static function setUri(Cfp $cfp, array $array) |
| 118 | 118 | { |
| 119 | - if (! isset($array['uri'])) { |
|
| 119 | + if (!isset($array['uri'])) { |
|
| 120 | 120 | throw new \InvalidArgumentException('URI has to be specified'); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -125,19 +125,19 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | public static function setEventUri(Cfp $cfp, array $array, Client $client) |
| 127 | 127 | { |
| 128 | - if (! isset($array['eventUri'])) { |
|
| 128 | + if (!isset($array['eventUri'])) { |
|
| 129 | 129 | throw new \InvalidArgumentException('Event-URI has to be specified'); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | try { |
| 133 | 133 | $uri = ''; |
| 134 | 134 | $client->get($array['eventUri'], [ |
| 135 | - 'on_stats' => function (TransferStats $stats) use (&$uri) { |
|
| 135 | + 'on_stats' => function(TransferStats $stats) use (&$uri) { |
|
| 136 | 136 | $uri = $stats->getEffectiveUri(); |
| 137 | 137 | } |
| 138 | 138 | ]); |
| 139 | 139 | } catch (\Exception $e) { |
| 140 | - throw new \InvalidArgumentException('Event-URI could not be verified: ' . $e->getMessage()); |
|
| 140 | + throw new \InvalidArgumentException('Event-URI could not be verified: '.$e->getMessage()); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $cfp->setEventUri(filter_var($uri, FILTER_VALIDATE_URL)); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | public static function setIconUri(Cfp $cfp, array $array) |
| 165 | 165 | { |
| 166 | - if (! isset($array['iconUri'])) { |
|
| 166 | + if (!isset($array['iconUri'])) { |
|
| 167 | 167 | return; |
| 168 | 168 | } |
| 169 | 169 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | public static function setDescription(Cfp $cfp, array $array) |
| 174 | 174 | { |
| 175 | - if (! isset($array['description'])) { |
|
| 175 | + if (!isset($array['description'])) { |
|
| 176 | 176 | return; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | public static function setLocation(Cfp $cfp, array $array) |
| 183 | 183 | { |
| 184 | - if (! isset($array['location'])) { |
|
| 184 | + if (!isset($array['location'])) { |
|
| 185 | 185 | return; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -190,15 +190,15 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | public static function setGeolocation(Cfp $cfp, array $array) |
| 192 | 192 | { |
| 193 | - if (! isset($array['latitude'])) { |
|
| 193 | + if (!isset($array['latitude'])) { |
|
| 194 | 194 | return; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - if (! isset($array['longitude'])) { |
|
| 197 | + if (!isset($array['longitude'])) { |
|
| 198 | 198 | return; |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - $latitude = filter_var( |
|
| 201 | + $latitude = filter_var( |
|
| 202 | 202 | $array['latitude'], |
| 203 | 203 | FILTER_SANITIZE_NUMBER_FLOAT, |
| 204 | 204 | FILTER_FLAG_ALLOW_FRACTION |
@@ -231,18 +231,18 @@ discard block |
||
| 231 | 231 | |
| 232 | 232 | public static function setTags(Cfp $cfp, array $array) |
| 233 | 233 | { |
| 234 | - if (! isset($array['tags'])) { |
|
| 234 | + if (!isset($array['tags'])) { |
|
| 235 | 235 | return; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - $cfp->setTags(array_map(function ($item) { |
|
| 238 | + $cfp->setTags(array_map(function($item) { |
|
| 239 | 239 | return filter_var($item, FILTER_SANITIZE_STRING); |
| 240 | 240 | }, $array['tags'])); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | public static function setSource(Cfp $cfp, array $array) |
| 244 | 244 | { |
| 245 | - if (! isset($array['source'])) { |
|
| 245 | + if (!isset($array['source'])) { |
|
| 246 | 246 | return; |
| 247 | 247 | } |
| 248 | 248 | |
@@ -60,13 +60,13 @@ |
||
| 60 | 60 | $response = $next($request, $response); |
| 61 | 61 | |
| 62 | 62 | $this->analytics |
| 63 | - ->setEventCategory($request->getUri()->getPath()) |
|
| 64 | - ->setEventAction($request->getMethod()) |
|
| 65 | - ->setEventLabel('type') |
|
| 66 | - ->setEventValue($response->getHeader('Content-Type')[0]) |
|
| 67 | - ->setIpOverride($request->getAttribute('ip_address')) |
|
| 68 | - ->setUserAgentOverride($request->getHeader('User-Agent')[0]) |
|
| 69 | - ->sendEvent(); |
|
| 63 | + ->setEventCategory($request->getUri()->getPath()) |
|
| 64 | + ->setEventAction($request->getMethod()) |
|
| 65 | + ->setEventLabel('type') |
|
| 66 | + ->setEventValue($response->getHeader('Content-Type')[0]) |
|
| 67 | + ->setIpOverride($request->getAttribute('ip_address')) |
|
| 68 | + ->setUserAgentOverride($request->getHeader('User-Agent')[0]) |
|
| 69 | + ->sendEvent(); |
|
| 70 | 70 | |
| 71 | 71 | return $response; |
| 72 | 72 | } |