Completed
Push — master ( 284840...1415b0 )
by Jake
02:54
created
phpunit.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 */ 
37 37
 $capsule = new Capsule; 
38 38
 $capsule->addConnection([ 
39
- 'driver'   => 'sqlite', 
40
- 'database' => ':memory:', 
39
+    'driver'   => 'sqlite', 
40
+    'database' => ':memory:', 
41 41
 ]); 
42 42
 $capsule->setEventDispatcher(new Dispatcher); 
43 43
 $capsule->setAsGlobal(); 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 $capsule->schema()->dropIfExists('models'); 
47 47
 
48 48
 $capsule->schema()->create('models', function (Blueprint $table) { 
49
-   $table->increments('id'); 
50
-   $table->string('string'); 
51
-   $table->string('email'); 
52
-   $table->timestamps(); 
49
+    $table->increments('id'); 
50
+    $table->string('string'); 
51
+    $table->string('email'); 
52
+    $table->timestamps(); 
53 53
 }); 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 | 
17 17
 */ 
18 18
 
19
-require __DIR__ . '/vendor/autoload.php'; 
19
+require __DIR__.'/vendor/autoload.php'; 
20 20
 
21 21
 /* 
22 22
 |-------------------------------------------------------------------------- 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 $capsule->schema()->dropIfExists('models'); 
47 47
 
48
-$capsule->schema()->create('models', function (Blueprint $table) { 
48
+$capsule->schema()->create('models', function(Blueprint $table) { 
49 49
    $table->increments('id'); 
50 50
    $table->string('string'); 
51 51
    $table->string('email'); 
Please login to merge, or discard this patch.
tests/AdminControllerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         m::close();
22 22
     }
23 23
     
24
-    public function testItReturnsTheDashboardIfUserIsAuthenticated ()
24
+    public function testItReturnsTheDashboardIfUserIsAuthenticated()
25 25
     {
26 26
         // $user = factory(App\User::class)->create();
27 27
         
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
        // $this->assertFalse($request);
34 34
     }
35 35
     
36
-    public function testItRedirectsToLoginIfUserIsNotAuthenticated ()
36
+    public function testItRedirectsToLoginIfUserIsNotAuthenticated()
37 37
     {
38 38
         //$request = $this->urlGenerator->to('admin')->assertRedirectedTo('login');
39 39
         $this->assertTrue(true);
Please login to merge, or discard this patch.
src/Migrations/2016_06_08_015633_create_sites_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('sites', function (Blueprint $table) {
15
+        Schema::create('sites', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('title');
18 18
             $table->string('twitter');
Please login to merge, or discard this patch.
src/Http/Controllers/AuthController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@
 block discarded – undo
7 7
 
8 8
 class AuthController extends Controller
9 9
 {
10
-    public function __construct () {
10
+    public function __construct() {
11 11
         $this->middleware('guest');
12 12
     }
13 13
     
14
-    public function showLoginForm () {
14
+    public function showLoginForm() {
15 15
         return view('Blue::auth.login');
16 16
     }
17 17
     
18
-    public function postLoginForm () {
18
+    public function postLoginForm() {
19 19
         return 'Posted!';
20 20
     }
21 21
     
22
-    public function showRegisterForm () {
22
+    public function showRegisterForm() {
23 23
         return view('Blue::auth.register');
24 24
     }
25 25
     
26
-    public function postRegisterForm () {
26
+    public function postRegisterForm() {
27 27
         return 'Posted!';
28 28
     }
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
src/Http/Controllers/PagesController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
 class PagesController extends Controller
13 13
 {
14
-    public function page ($page = null) {
14
+    public function page($page = null) {
15 15
         if (is_null($page)) {
16 16
             return SEO::make([], 'Blue::home');
17 17
         }
Please login to merge, or discard this patch.
src/Http/Controllers/AdminController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 class AdminController extends Controller
9 9
 {
10
-    public function __construct () {
10
+    public function __construct() {
11 11
         $this->middleware('auth');
12 12
     }
13 13
     
14
-    public function index () {
14
+    public function index() {
15 15
         return redirect('admin/dashboard');
16 16
     }
17 17
     
18
-    public function showDashboard () {
18
+    public function showDashboard() {
19 19
         return view('Blue::admin.dashboard');
20 20
     }
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('insert_if_exists')) {
4
-    function insert_if_exists ($insert, $template = null, $match = null) {
3
+if (!function_exists('insert_if_exists')) {
4
+    function insert_if_exists($insert, $template = null, $match = null) {
5 5
         if (!is_null($insert)) { // if item exists
6 6
             if (is_array($insert)) { // if more than one item is given
7 7
                 $ret = ''; // total of all items to return
Please login to merge, or discard this patch.
src/SEOGenerator.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public $defaults;
12 12
     public static $favicons;
13 13
     
14
-    public function __construct () {
14
+    public function __construct() {
15 15
         $this->defaults = [
16 16
             'title' => 'Home',
17 17
             'title-spacer' => ' &#8211; ',
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         ];
32 32
     }
33 33
     
34
-    public function generateSEO (array $page)
34
+    public function generateSEO(array $page)
35 35
     {
36 36
         SEOTools::metatags()
37 37
             ->setTitleDefault($page['title-description'])
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         }
67 67
     }
68 68
     
69
-    public function make (array $details, $view = null)
69
+    public function make(array $details, $view = null)
70 70
     {
71 71
         $this->defaults = array_replace($this->defaults, $details);
72 72
         
@@ -77,66 +77,66 @@  discard block
 block discarded – undo
77 77
         }
78 78
     }
79 79
     
80
-    public function get ()
80
+    public function get()
81 81
     {
82
-        return str_replace(PHP_EOL, '', SEOTools::generate()) . $this->getFavicons();
82
+        return str_replace(PHP_EOL, '', SEOTools::generate()).$this->getFavicons();
83 83
     }
84 84
     
85
-    public function setFavicons () 
85
+    public function setFavicons() 
86 86
     {
87 87
         $favicon_dir = insert_if_exists($this->defaults['icon_dir']);
88 88
         $colors = $this->defaults['colors'];
89 89
         self::$favicons =
90
-                insert_if_exists (['60x60', '72x72', '114x114', '120x120', '152x152', '180x180'], function ($insert) use ($favicon_dir) {
91
-                        return '<link rel="apple-touch-icon" sizes="' . $insert . '" href="' . asset($favicon_dir . '/apple-touch-icon-' . $insert . '.png').'">';
92
-                    }, function ($insert) use ($favicon_dir) {
90
+                insert_if_exists(['60x60', '72x72', '114x114', '120x120', '152x152', '180x180'], function($insert) use ($favicon_dir) {
91
+                        return '<link rel="apple-touch-icon" sizes="'.$insert.'" href="'.asset($favicon_dir.'/apple-touch-icon-'.$insert.'.png').'">';
92
+                    }, function($insert) use ($favicon_dir) {
93 93
                         return File::exists(public_path($favicon_dir.'/apple-touch-icon-'.$insert.'.png'));
94
-                    }) . 
95
-                insert_if_exists (['16x16', '32x32', '96x96', '194x194'], function ($insert) use ($favicon_dir) {
96
-                        return '<link rel="icon" type="image/png" href="' . asset($favicon_dir . '/favicon-' . $insert . '.png').'" sizes="'.$insert.'">';
97
-                    }, function ($insert) use ($favicon_dir) {
94
+                    }). 
95
+                insert_if_exists(['16x16', '32x32', '96x96', '194x194'], function($insert) use ($favicon_dir) {
96
+                        return '<link rel="icon" type="image/png" href="'.asset($favicon_dir.'/favicon-'.$insert.'.png').'" sizes="'.$insert.'">';
97
+                    }, function($insert) use ($favicon_dir) {
98 98
                         return File::exists(public_path($favicon_dir.'/favicon-'.$insert.'.png'));
99
-                    }) . 
100
-                insert_if_exists (['192x192'], function ($insert) use ($favicon_dir) {
101
-                        return '<link rel="icon" type="image/png" href="' . asset($favicon_dir . '/android-chrome-' . $insert . '.png').'" sizes="'.$insert.'">';
102
-                    }, function ($insert) use ($favicon_dir) {
99
+                    }). 
100
+                insert_if_exists(['192x192'], function($insert) use ($favicon_dir) {
101
+                        return '<link rel="icon" type="image/png" href="'.asset($favicon_dir.'/android-chrome-'.$insert.'.png').'" sizes="'.$insert.'">';
102
+                    }, function($insert) use ($favicon_dir) {
103 103
                         return File::exists(public_path($favicon_dir.'/android-chrome-'.$insert.'.png'));
104
-                    }) . 
105
-                insert_if_exists ($favicon_dir.'/manifest.json', function ($insert) {
106
-                        return '<link rel="manifest" href="' . asset($insert) . '">';
107
-                    }, function ($insert) {
104
+                    }). 
105
+                insert_if_exists($favicon_dir.'/manifest.json', function($insert) {
106
+                        return '<link rel="manifest" href="'.asset($insert).'">';
107
+                    }, function($insert) {
108 108
                         return File::exists(public_path($insert));
109
-                    }) . 
110
-                insert_if_exists ($favicon_dir.'/safari-pinned-tab.svg', function ($insert) use ($colors) {
111
-                        return '<link rel="mask-icon" href="'.asset($insert).'" color="' . insert_if_exists($colors['safari_pinned']) . '">';
112
-                    }, function ($insert) {
109
+                    }). 
110
+                insert_if_exists($favicon_dir.'/safari-pinned-tab.svg', function($insert) use ($colors) {
111
+                        return '<link rel="mask-icon" href="'.asset($insert).'" color="'.insert_if_exists($colors['safari_pinned']).'">';
112
+                    }, function($insert) {
113 113
                         return File::exists(public_path($insert));
114
-                    }) . 
115
-                insert_if_exists ($favicon_dir.'/favicon.ico', function ($insert) {
114
+                    }). 
115
+                insert_if_exists($favicon_dir.'/favicon.ico', function($insert) {
116 116
                         return '<link rel="shortcut icon" href="'.asset($insert).'">';
117
-                    }, function ($insert) {
117
+                    }, function($insert) {
118 118
                         return File::exists(public_path($insert));
119
-                    }) . 
120
-                insert_if_exists ($favicon_dir.'/mstile-144x144.png', function ($insert) {
119
+                    }). 
120
+                insert_if_exists($favicon_dir.'/mstile-144x144.png', function($insert) {
121 121
                         return '<meta name="msapplication-TileImage" content="'.asset($insert).'">';
122
-                    }, function ($insert) {
122
+                    }, function($insert) {
123 123
                         return File::exists(public_path($insert));
124
-                    }) . 
125
-                insert_if_exists ($favicon_dir.'/browserconfig.xml', function ($insert) {
124
+                    }). 
125
+                insert_if_exists($favicon_dir.'/browserconfig.xml', function($insert) {
126 126
                         return '<meta name="msapplication-config" content="'.asset($insert).'">';
127
-                    }, function ($insert) {
127
+                    }, function($insert) {
128 128
                         return File::exists(public_path($insert));
129
-                    }) . 
130
-                insert_if_exists ($colors['ms_tile'], function ($insert) {
129
+                    }). 
130
+                insert_if_exists($colors['ms_tile'], function($insert) {
131 131
                         return '<meta name="msapplication-TileColor" content="'.$insert.'">';
132
-                    }) . 
133
-                insert_if_exists ($colors['theme'], function ($insert) {
132
+                    }). 
133
+                insert_if_exists($colors['theme'], function($insert) {
134 134
                         return '<meta name="theme-color" content="'.$insert.'">';
135 135
                     });
136 136
         return self::$favicons;
137 137
     }
138 138
     
139
-    public function getFavicons () 
139
+    public function getFavicons() 
140 140
     {
141 141
         if (is_null(self::$favicons)) {
142 142
             return $this->setFavicons();
Please login to merge, or discard this patch.
src/Http/routes.blue.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,23 +2,23 @@
 block discarded – undo
2 2
 
3 3
 Route::group(['namespace' => 'MeestorHok\\Blue\\Http\\Controllers', 'middleware' => 'web'], function()
4 4
 {
5
-    Route::group(['middleware' => 'siteDoesntExist'], function () 
5
+    Route::group(['middleware' => 'siteDoesntExist'], function() 
6 6
     { // if the user hasn't created a site yet
7 7
         Route::get('new', 'SiteController@showCreateForm');
8 8
         Route::post('new', 'SiteController@createSite')->name('create.site');
9 9
     });
10 10
     
11
-    Route::group(['middleware' => 'siteExists'], function () 
11
+    Route::group(['middleware' => 'siteExists'], function() 
12 12
     { // At least one site exists
13
-        Route::group(['middleware' => 'adminDoesntExist'], function () 
13
+        Route::group(['middleware' => 'adminDoesntExist'], function() 
14 14
         { // if no admin exists yet
15 15
             Route::get('admin/new', 'SiteController@showAdminForm');
16 16
             Route::post('admin/new', 'SiteController@createAdmin')->name('create.admin');
17 17
         });
18 18
         
19
-        Route::group(['middleware' => 'adminExists'], function ()
19
+        Route::group(['middleware' => 'adminExists'], function()
20 20
         { // At least one admin exists
21
-            Route::group(['prefix' => 'admin'], function () 
21
+            Route::group(['prefix' => 'admin'], function() 
22 22
             {
23 23
                 Route::get('/', 'AdminController@index');
24 24
                 Route::get('dashboard', 'AdminController@showDashboard');
Please login to merge, or discard this patch.