Completed
Pull Request — master (#63)
by
unknown
31s
created
config/dependencies.php 2 patches
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.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@
 block discarded – undo
35 35
 $container['googleAnalytics'] = function($c) {
36 36
     $ga = new \TheIconic\Tracking\GoogleAnalytics\Analytics(true);
37 37
     $ga->setProtocolVersion(1)
38
-       ->setTrackingId($c->get('settings')['ga']['trackingCode'])
39
-       ->setClientId(\Sabre\VObject\UUIDUtil::getUUID())
40
-       ->setAnonymizeIp(true)
41
-       ->setAsyncRequest(true);
38
+        ->setTrackingId($c->get('settings')['ga']['trackingCode'])
39
+        ->setClientId(\Sabre\VObject\UUIDUtil::getUUID())
40
+        ->setAnonymizeIp(true)
41
+        ->setAsyncRequest(true);
42 42
 
43 43
     return $ga;
44 44
 };
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/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/Renderer/RssRenderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
public/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,22 +27,22 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Middleware/ConvertTypeToAccept.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Middleware/NotifyGoogleAnalytics.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,13 +60,13 @@
 block discarded – undo
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
     }
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
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
                 'sources'        => array_values(array_filter(array_unique($cfp->getSource()))),
54 54
                 'lastChange'     => $cfp->getLastUdated()->format('c'),
55 55
                 '_rel'            => [
56
-                    'cfp_uri'    => 'v1/cfp/' . $cfp->getHash(),
56
+                    'cfp_uri'    => 'v1/cfp/'.$cfp->getHash(),
57 57
                 ]
58 58
             ];
59 59
 
Please login to merge, or discard this patch.
config/routes.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     \Psr\Http\Message\ResponseInterface $response
44 44
 ) use ($app){
45 45
     $params = $request->getParsedBody();
46
-    if (! is_array($params)) {
46
+    if (!is_array($params)) {
47 47
         throw new UnexpectedValueException('Expected array');
48 48
     }
49 49
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     try {
52 52
         $cfp = $cfpFactory->createCfp($params, $app->getContainer()['client']);
53 53
     } catch (\Exception $e) {
54
-        error_log($e->getMessage() . "\n" . $e->getTraceAsString());
54
+        error_log($e->getMessage()."\n".$e->getTraceAsString());
55 55
     }
56 56
     $cpl = new \Callingallpapers\Api\PersistenceLayer\CfpPersistenceLayer(
57 57
         $app->getContainer()['pdo'],
@@ -60,18 +60,18 @@  discard block
 block discarded – undo
60 60
     $cpl->insert($cfp);
61 61
 
62 62
     $uri = $request->getUri();
63
-    $uri = $uri->withPath('v1/cfp/' . $cfp->getId());
63
+    $uri = $uri->withPath('v1/cfp/'.$cfp->getId());
64 64
     return $response->withRedirect((string)$uri, 201);
65 65
 });
66 66
 
67 67
 
68
-$app->put('/v1/cfp/{hash}', function (
68
+$app->put('/v1/cfp/{hash}', function(
69 69
     \Psr\Http\Message\ServerRequestInterface $request,
70 70
     \Psr\Http\Message\ResponseInterface $response,
71 71
     array $args
72 72
 ) use ($app){
73 73
     $params = $request->getParsedBody();
74
-    if (! is_array($params)) {
74
+    if (!is_array($params)) {
75 75
         throw new UnexpectedValueException('Expected array');
76 76
     }
77 77
 
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
     $cpl->update($cfp, $args['hash']);
86 86
 
87 87
     $uri = $request->getUri();
88
-    $uri = $uri->withPath('v1/cfp/' . $cfp->getId());
88
+    $uri = $uri->withPath('v1/cfp/'.$cfp->getId());
89 89
     return $response->withHeader('Location', (string)$uri)->withStatus(204);
90 90
 });
91 91
 
92 92
 
93
-$app->delete('/v1/cfp/{id}', function (
93
+$app->delete('/v1/cfp/{id}', function(
94 94
     \Psr\Http\Message\ServerRequestInterface $request,
95 95
     \Psr\Http\Message\ResponseInterface $response
96 96
 ) use ($app){
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     return $response->withHeader('Content-Length', '0')->withStatus(204);
105 105
 });
106 106
 
107
-$app->get('/v1/search', function (
107
+$app->get('/v1/search', function(
108 108
     \Psr\Http\Message\ServerRequestInterface $request,
109 109
     \Psr\Http\Message\ResponseInterface $response,
110 110
     array $args
@@ -119,5 +119,5 @@  discard block
 block discarded – undo
119 119
 
120 120
     $cfpMapper = new \Callingallpapers\Api\Entity\CfpListMapper();
121 121
 
122
-    return $this->view->render($response, $cfpMapper->map($list), 200, 'cfp/list.twig');;
122
+    return $this->view->render($response, $cfpMapper->map($list), 200, 'cfp/list.twig'); ;
123 123
 });
Please login to merge, or discard this patch.