@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | public function setTimezone($timezone) |
248 | 248 | { |
249 | - if (! $timezone instanceof \DateTimeZone) { |
|
249 | + if (!$timezone instanceof \DateTimeZone) { |
|
250 | 250 | $timezone = new \DateTimeZone($timezone); |
251 | 251 | } |
252 | 252 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | |
296 | 296 | public function addSource($source) |
297 | 297 | { |
298 | - if (! in_array($source)) { |
|
298 | + if (!in_array($source)) { |
|
299 | 299 | $this->source[] = $source; |
300 | 300 | } |
301 | 301 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | callable $next |
52 | 52 | ) { |
53 | 53 | $query = $request->getQueryParams(); |
54 | - if (! isset($query['type'])) { |
|
54 | + if (!isset($query['type'])) { |
|
55 | 55 | return $next($request, $response); |
56 | 56 | } |
57 | 57 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | \Psr\Http\Message\ResponseInterface $response |
42 | 42 | ) use ($app){ |
43 | 43 | $params = $request->getParsedBody(); |
44 | - if (! is_array($params)) { |
|
44 | + if (!is_array($params)) { |
|
45 | 45 | throw new UnexpectedValueException('Expected array'); |
46 | 46 | } |
47 | 47 | |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | $cpl->insert($cfp); |
55 | 55 | |
56 | 56 | $uri = $request->getUri(); |
57 | - $uri = $uri->withPath('v1/cfp/' . $cfp->getId()); |
|
57 | + $uri = $uri->withPath('v1/cfp/'.$cfp->getId()); |
|
58 | 58 | return $response->withRedirect((string)$uri, 201); |
59 | 59 | }); |
60 | 60 | |
61 | 61 | |
62 | -$app->put('/v1/cfp/{hash}', function ( |
|
62 | +$app->put('/v1/cfp/{hash}', function( |
|
63 | 63 | \Psr\Http\Message\ServerRequestInterface $request, |
64 | 64 | \Psr\Http\Message\ResponseInterface $response, |
65 | 65 | array $args |
66 | 66 | ) use ($app){ |
67 | 67 | $params = $request->getParsedBody(); |
68 | - if (! is_array($params)) { |
|
68 | + if (!is_array($params)) { |
|
69 | 69 | throw new UnexpectedValueException('Expected array'); |
70 | 70 | } |
71 | 71 | |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | $cpl->update($cfp, $args['hash']); |
79 | 79 | |
80 | 80 | $uri = $request->getUri(); |
81 | - $uri = $uri->withPath('v1/cfp/' . $cfp->getId()); |
|
81 | + $uri = $uri->withPath('v1/cfp/'.$cfp->getId()); |
|
82 | 82 | return $response->withHeader('Location', (string)$uri)->withStatus(204); |
83 | 83 | }); |
84 | 84 | |
85 | 85 | |
86 | -$app->delete('/v1/cfp/{id}', function ( |
|
86 | +$app->delete('/v1/cfp/{id}', function( |
|
87 | 87 | \Psr\Http\Message\ServerRequestInterface $request, |
88 | 88 | \Psr\Http\Message\ResponseInterface $response |
89 | 89 | ) use ($app){ |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | return $response->withHeader('Content-Length', '0')->withStatus(204); |
97 | 97 | }); |
98 | 98 | |
99 | -$app->get('/v1/search', function ( |
|
99 | +$app->get('/v1/search', function( |
|
100 | 100 | \Psr\Http\Message\ServerRequestInterface $request, |
101 | 101 | \Psr\Http\Message\ResponseInterface $response, |
102 | 102 | array $args |
@@ -110,5 +110,5 @@ discard block |
||
110 | 110 | |
111 | 111 | $cfpMapper = new \Callingallpapers\Api\Entity\CfpListMapper(); |
112 | 112 | |
113 | - return $this->view->render($response, $cfpMapper->map($list), 200, 'cfp/list.twig');; |
|
113 | + return $this->view->render($response, $cfpMapper->map($list), 200, 'cfp/list.twig'); ; |
|
114 | 114 | }); |
@@ -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')) |
|
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')) |
|
69 | + ->sendEvent(); |
|
70 | 70 | |
71 | 71 | return $response; |
72 | 72 | } |