Completed
Pull Request — erdiko2 (#45)
by
unknown
06:38
created
app/controllers/Grid.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         ];
26 26
 
27 27
         $items = array();
28
-        for($i = 0; $i < $args['count']; $i++) {
28
+        for ($i = 0; $i < $args['count']; $i++) {
29 29
             $item['name'] = "Item $i";
30 30
             $items[] = $item;
31 31
         }
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@  discard block
 block discarded – undo
3 3
 
4 4
 class Grid extends \erdiko\Controller
5 5
 {   
6
-	public function __invoke($request, $response, $args) 
7
-	{
6
+    public function __invoke($request, $response, $args) 
7
+    {
8 8
         $this->container->logger->debug("/controller");
9
-   		$view = 'pages/grid.html';
9
+            $view = 'pages/grid.html';
10 10
 
11 11
         // Get erdiko config, this gets application.json and loads the theme specified
12 12
         $config = \erdiko\theme\Config::get();        
@@ -29,6 +29,6 @@  discard block
 block discarded – undo
29 29
         }
30 30
         $config['items'] = $items;
31 31
 
32
-   		return $this->container->theme->render($response, $view, $config);
33
-  	}
32
+            return $this->container->theme->render($response, $view, $config);
33
+        }
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
tests/Functional/HomepageTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
         $response = $this->runApp('GET', '/');
13 13
 
14 14
         $this->assertEquals(200, $response->getStatusCode());
15
-        $this->assertContains('SlimFramework', (string)$response->getBody());
16
-        $this->assertNotContains('Hello', (string)$response->getBody());
15
+        $this->assertContains('SlimFramework', (string) $response->getBody());
16
+        $this->assertNotContains('Hello', (string) $response->getBody());
17 17
     }
18 18
 
19 19
     /**
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         $response = $this->runApp('GET', '/name');
25 25
 
26 26
         $this->assertEquals(200, $response->getStatusCode());
27
-        $this->assertContains('Hello name!', (string)$response->getBody());
27
+        $this->assertContains('Hello name!', (string) $response->getBody());
28 28
     }
29 29
 
30 30
     /**
@@ -35,6 +35,6 @@  discard block
 block discarded – undo
35 35
         $response = $this->runApp('POST', '/', ['test']);
36 36
 
37 37
         $this->assertEquals(405, $response->getStatusCode());
38
-        $this->assertContains('Method not allowed', (string)$response->getBody());
38
+        $this->assertContains('Method not allowed', (string) $response->getBody());
39 39
     }
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
tests/Functional/BaseTestCase.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,21 +52,21 @@
 block discarded – undo
52 52
         $response = new Response();
53 53
 
54 54
         // Use the application settings
55
-        $settings = require __DIR__ . '/../../src/settings.php';
55
+        $settings = require __DIR__.'/../../src/settings.php';
56 56
 
57 57
         // Instantiate the application
58 58
         $app = new App($settings);
59 59
 
60 60
         // Set up dependencies
61
-        require __DIR__ . '/../../src/dependencies.php';
61
+        require __DIR__.'/../../src/dependencies.php';
62 62
 
63 63
         // Register middleware
64 64
         if ($this->withMiddleware) {
65
-            require __DIR__ . '/../../src/middleware.php';
65
+            require __DIR__.'/../../src/middleware.php';
66 66
         }
67 67
 
68 68
         // Register routes
69
-        require __DIR__ . '/../../src/routes.php';
69
+        require __DIR__.'/../../src/routes.php';
70 70
 
71 71
         // Process the application
72 72
         $response = $app->process($request, $response);
Please login to merge, or discard this patch.
contexts/default/bootstrap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 // Set up dependencies
3
-require_once __DIR__ . '/bootstrap/dependencies.php';
3
+require_once __DIR__.'/bootstrap/dependencies.php';
4 4
 
5 5
 // Register middleware
6
-require_once __DIR__ . '/bootstrap/middleware.php';
6
+require_once __DIR__.'/bootstrap/middleware.php';
7 7
 
8 8
 // Register routes
9
-require_once __DIR__ . '/bootstrap/routes.php';
9
+require_once __DIR__.'/bootstrap/routes.php';
Please login to merge, or discard this patch.
contexts/default/bootstrap/settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         // Monolog settings
14 14
         'logger' => [
15 15
             'name' => 'erdiko-default',
16
-            'path' => ERDIKO_ROOT . '/var/logs/app.log',
16
+            'path' => ERDIKO_ROOT.'/var/logs/app.log',
17 17
             'level' => \Monolog\Logger::DEBUG,
18 18
         ],
19 19
 
Please login to merge, or discard this patch.
contexts/default/bootstrap/routes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Application Routes
3 3
 
4
-$app->get('/', function ($request, $response, $args) {
4
+$app->get('/', function($request, $response, $args) {
5 5
     // Render index view
6 6
     return $this->theme->render($response, 'slim.phtml', $args);
7 7
 });
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 //    ->setName('home');
12 12
 
13 13
 // Render Twig template in route
14
-$app->any('/render/[{name}]', function ($request, $response, $args) {
14
+$app->any('/render/[{name}]', function($request, $response, $args) {
15 15
     // Erdiko setup (load configs)
16 16
     // $erdiko = \erdiko\App;
17 17
     // $erdiko->load('application');
Please login to merge, or discard this patch.
contexts/blog/bootstrap/settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
         // Monolog settings
14 14
         'logger' => [
15 15
             'name' => 'erdiko-blog',
16
-            'path' => ERDIKO_ROOT . '/var/logs/app.log',
16
+            'path' => ERDIKO_ROOT.'/var/logs/app.log',
17 17
             'level' => \Monolog\Logger::DEBUG,
18 18
         ],
19 19
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             'templates' => [
23 23
                 '../app/templates', 
24 24
                 '../vendor/erdiko/wordpress/templates', 
25
-                '../vendor/erdiko/theme/templates' ],
25
+                '../vendor/erdiko/theme/templates'],
26 26
             'debug' => true,
27 27
             'cache' => false
28 28
             //'cache' => '/tmp/erdiko/theme'
Please login to merge, or discard this patch.
contexts/blog/bootstrap/bootstrap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 // Set up dependencies
3
-require_once __DIR__ . '/dependencies.php';
3
+require_once __DIR__.'/dependencies.php';
4 4
 
5 5
 // Register middleware
6
-require_once __DIR__ . '/middleware.php';
6
+require_once __DIR__.'/middleware.php';
7 7
 
8 8
 // Register routes
9
-require_once __DIR__ . '/routes.php';
9
+require_once __DIR__.'/routes.php';
Please login to merge, or discard this patch.
contexts/blog/bootstrap/dependencies.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 $container = $app->getContainer();
4 4
 
5 5
 // Monolog
6
-$container['logger'] = function ($container) {
6
+$container['logger'] = function($container) {
7 7
     $settings = $container->get('settings')['logger'];
8 8
     $logger = new Monolog\Logger($settings['name']);
9 9
     $logger->pushProcessor(new Monolog\Processor\UidProcessor());
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 };
13 13
 
14 14
 // Register flash provider
15
-$container['flash'] = function () {
15
+$container['flash'] = function() {
16 16
     return new \Slim\Flash\Messages();
17 17
 };
18 18
 
19 19
 // Theme view (erdiko, twig)
20
-$container['theme'] = function ($container) {
20
+$container['theme'] = function($container) {
21 21
     $settings = $container->get('settings')['theme'];
22 22
     $view = new \Slim\Views\Twig($settings['templates'], [
23 23
         'debug' => $settings['debug'],
@@ -35,15 +35,15 @@  discard block
 block discarded – undo
35 35
     ));
36 36
     $view->addExtension(new erdiko\wordpress\twig\Extension);    
37 37
 
38
-    if($settings['debug'] == true)
38
+    if ($settings['debug'] == true)
39 39
         $view->addExtension(new \Twig_Extension_Debug());
40 40
 
41 41
     return $view;
42 42
 };
43 43
 
44 44
 // 404 Handler
45
-$container['notFoundHandler'] = function ($container) {
46
-    return function ($request, $response) use ($container) {
45
+$container['notFoundHandler'] = function($container) {
46
+    return function($request, $response) use ($container) {
47 47
         $themeData = \erdiko\theme\Config::get();
48 48
         return $container['theme']->render($response->withStatus(404), '404.html', $themeData);
49 49
     };
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@
 block discarded – undo
35 35
     ));
36 36
     $view->addExtension(new erdiko\wordpress\twig\Extension);    
37 37
 
38
-    if($settings['debug'] == true)
39
-        $view->addExtension(new \Twig_Extension_Debug());
38
+    if($settings['debug'] == true) {
39
+            $view->addExtension(new \Twig_Extension_Debug());
40
+    }
40 41
 
41 42
     return $view;
42 43
 };
Please login to merge, or discard this patch.