Test Failed
Branch ft/package (7b41d6)
by Philippe
12:42
created
src/Common/Traits/Featurable.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
     public function scopeFeatured($query)
13 13
     {
14
-        $query->where('featured',1);
14
+        $query->where('featured', 1);
15 15
     }
16 16
 
17 17
     public function feature()
Please login to merge, or discard this patch.
src/Common/Traits/CheckPreviewTrait.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@
 block discarded – undo
9 9
 {
10 10
     public function isPreviewAllowed()
11 11
     {
12
-        if(request()->has('preview-mode') && Auth::guard('chief')->check())
12
+        if (request()->has('preview-mode') && Auth::guard('chief')->check())
13 13
         {
14 14
             Session::now('note.default', 'U bekijkt een preview.');
15 15
             return true;
16
-        }else{
16
+        }else {
17 17
             return false;
18 18
         }
19 19
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         {
14 14
             Session::now('note.default', 'U bekijkt een preview.');
15 15
             return true;
16
-        }else{
16
+        } else{
17 17
             return false;
18 18
         }
19 19
     }
Please login to merge, or discard this patch.
src/Common/Relations/ActingAsParent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
     public function children(): Collection
12 12
     {
13
-        if($this->areChildRelationsLoaded()){
13
+        if ($this->areChildRelationsLoaded()) {
14 14
             return $this->loadedChildRelations;
15 15
         }
16 16
         return $this->loadedChildRelations = Relation::children($this->getMorphClass(), $this->getKey());
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function presentChildren(): \Illuminate\Support\Collection
36 36
     {
37
-        return $this->children()->map(function($child){
37
+        return $this->children()->map(function($child) {
38 38
             return $child->presentForParent($this, $child->relation);
39 39
         });
40 40
     }
Please login to merge, or discard this patch.
src/Common/Relations/Relation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
             ->orderBy('sort', 'ASC')
18 18
             ->get();
19 19
 
20
-        return $relations->map(function ($relation) {
20
+        return $relations->map(function($relation) {
21 21
             $parent = (new $relation->parent_type)->find($relation->parent_id);
22 22
             $parent->relation = $relation;
23 23
             return $parent;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             ->orderBy('sort', 'ASC')
32 32
             ->get();
33 33
 
34
-        return $relations->map(function ($relation) {
34
+        return $relations->map(function($relation) {
35 35
             $child = (new $relation->child_type)->find($relation->child_id);
36 36
             $child->relation = $relation;
37 37
             return $child;
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
         return [
50 50
             [
51 51
                 'label' => 'Pagina\'s',
52
-                'values' => Page::all()->map(function($page){
53
-                    return ['composite_id' => $page->getMorphClass().'@'.$page->id, 'label' => 'Pagina ' . teaser($page->title, 20, '...')];
52
+                'values' => Page::all()->map(function($page) {
53
+                    return ['composite_id' => $page->getMorphClass().'@'.$page->id, 'label' => 'Pagina '.teaser($page->title, 20, '...')];
54 54
                 })->toArray(),
55 55
             ]
56 56
         ];
Please login to merge, or discard this patch.
src/Common/Relations/ActingAsChild.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
     public function parents(): Collection
12 12
     {
13
-        if($this->areParentRelationsLoaded()){
13
+        if ($this->areParentRelationsLoaded()) {
14 14
             return $this->loadedParentRelations;
15 15
         }
16 16
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             'parent_id'    => $parent_id,
51 51
             'child_type' => $this->getMorphClass(),
52 52
             'child_id'   => $this->getKey(),
53
-        ],$attributes);
53
+        ], $attributes);
54 54
     }
55 55
 
56 56
     private function detachParent($parent_type, $parent_id)
Please login to merge, or discard this patch.
src/Common/Relations/RelatedCollection.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
         $collection = new static();
14 14
 
15
-        foreach($available_children_types as $type) {
15
+        foreach ($available_children_types as $type) {
16 16
             $collection = $collection->merge((new $type)->all());
17 17
         }
18 18
 
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
     
22 22
     public static function relationIds(Collection $collection): Collection
23 23
     {
24
-        return $collection->map(function($entry){
24
+        return $collection->map(function($entry) {
25 25
             return $entry->getRelationId();
26 26
         });    
27 27
     }
28 28
 
29 29
     public function flattenForSelect()
30 30
     {
31
-        return $this->map(function(ActsAsChild $child){
31
+        return $this->map(function(ActsAsChild $child) {
32 32
             return [
33 33
                 'id'    => $child->getRelationId(),
34 34
                 'label' => $child->getRelationLabel(),
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
         $grouped = [];
43 43
 
44 44
         $this->flattenForSelect()->each(function($entry) use(&$grouped){
45
-            if(isset($grouped[$entry['group']])){
45
+            if (isset($grouped[$entry['group']])) {
46 46
                 $grouped[$entry['group']]['values'][] = $entry;
47
-            } else{
47
+            }else {
48 48
                 $grouped[$entry['group']] = ['group' => $entry['group'], 'values' => [$entry]];
49 49
             }
50 50
         });
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 
56 56
     public static function inflate(array $relateds = []): self
57 57
     {
58
-        if(count($relateds) == 1 && is_null(reset($relateds))) $relateds = [];
58
+        if (count($relateds) == 1 && is_null(reset($relateds))) $relateds = [];
59 59
 
60
-        return (new static($relateds))->map(function($related){
60
+        return (new static($relateds))->map(function($related) {
61 61
 
62
-            list($type,$id) = explode('@', $related);
62
+            list($type, $id) = explode('@', $related);
63 63
             return (new $type)->find($id);
64 64
 
65 65
         });
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@
 block discarded – undo
55 55
 
56 56
     public static function inflate(array $relateds = []): self
57 57
     {
58
-        if(count($relateds) == 1 && is_null(reset($relateds))) $relateds = [];
58
+        if(count($relateds) == 1 && is_null(reset($relateds))) {
59
+            $relateds = [];
60
+        }
59 61
 
60 62
         return (new static($relateds))->map(function($related){
61 63
 
Please login to merge, or discard this patch.
src/Common/UniqueSlug.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $slug = $originalslug = Str::slug($title);
28 28
         $i = 1;
29 29
 
30
-        while(!$this->isSlugUnique($slug,$entity))
30
+        while (!$this->isSlugUnique($slug, $entity))
31 31
         {
32 32
             $slug = $originalslug.'-'.$i;
33 33
             $i++;
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
      * @param SluggableContract $entity
43 43
      * @return bool
44 44
      */
45
-    private function isSlugUnique($slug,SluggableContract $entity = null)
45
+    private function isSlugUnique($slug, SluggableContract $entity = null)
46 46
     {
47 47
         $model = $this->model->findBySlug($slug);
48 48
 
49
-        if(!$model || ($entity && $entity->id && $model->id == $entity->id)) return true;
49
+        if (!$model || ($entity && $entity->id && $model->id == $entity->id)) return true;
50 50
 
51 51
         return false;
52 52
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,9 @@
 block discarded – undo
46 46
     {
47 47
         $model = $this->model->findBySlug($slug);
48 48
 
49
-        if(!$model || ($entity && $entity->id && $model->id == $entity->id)) return true;
49
+        if(!$model || ($entity && $entity->id && $model->id == $entity->id)) {
50
+            return true;
51
+        }
50 52
 
51 53
         return false;
52 54
     }
Please login to merge, or discard this patch.
routes/back.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
  * SPIRIT ROUTES
6 6
  * -----------------------------------------------------------------
7 7
  */
8
-Route::get('spirit/{section?}/{item?}', ['as' => 'spirit.index', 'uses' => function($section = null, $item = null){
8
+Route::get('spirit/{section?}/{item?}', ['as' => 'spirit.index', 'uses' => function($section = null, $item = null) {
9 9
 
10
-    if($section && $item && view()->exists('spirit.'.$section.'.'.$item)){
10
+    if ($section && $item && view()->exists('spirit.'.$section.'.'.$item)) {
11 11
         return view('spirit.'.$section.'.'.$item);
12 12
     }
13 13
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  * PROTOTYPING ROUTES
35 35
  * -----------------------------------------------------------------
36 36
  */
37
-Route::get('prototype', function(){
37
+Route::get('prototype', function() {
38 38
     // Just to guide Johnny to the proper page - this route can be removed afterwards
39 39
     return redirect()->route('back.pages.create');
40 40
 });
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
  * ADMIN ROUTES
45 45
  * -----------------------------------------------------------------
46 46
  */
47
-Route::group(['prefix' => 'admin','middleware' =>'auth:admin'],function()
47
+Route::group(['prefix' => 'admin', 'middleware' =>'auth:admin'], function()
48 48
 {
49 49
 
50 50
     Route::get('logout', 'Auth\LoginController@logout')->name('back.logout');
51 51
 
52
-    Route::get('/',function(){
52
+    Route::get('/', function() {
53 53
         return view('back.dashboard');
54 54
     })->name('back.dashboard');
55 55
 
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 
58 58
 
59 59
     // pageS
60
-    Route::get('pages','Back\PagesController@index')->name('back.pages.index');
60
+    Route::get('pages', 'Back\PagesController@index')->name('back.pages.index');
61 61
     Route::post('pages', 'Back\PagesController@store')->name('back.pages.store');
62 62
     Route::get('pages/create', 'Back\PagesController@create')->name('back.pages.create');
63 63
     Route::delete('pages/{id}', 'Back\PagesController@destroy')->name('back.pages.destroy');
64 64
     Route::put('pages/{id}', 'Back\PagesController@update')->name('back.pages.update');
65 65
     Route::get('pages/{id}/edit', 'Back\PagesController@edit')->name('back.pages.edit');
66
-    Route::post('pages/publish','Back\PagesController@publish')->name('back.pages.publish');
66
+    Route::post('pages/publish', 'Back\PagesController@publish')->name('back.pages.publish');
67 67
 
68 68
     Route::get('media', 'Back\MediaLibraryController@library')->name('media.library');
69 69
     Route::get('media-modal', 'Back\MediaLibraryController@mediaModal')->name('media.modal');
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 
75 75
     Route::post('page/{id}/upload', 'Back\PagesController@upload')->name('page.upload');
76 76
 
77
-    Route::get('/settings',['as' => 'back.settings.index','uses' => Back\System\SettingsController::class.'@show']);
77
+    Route::get('/settings', ['as' => 'back.settings.index', 'uses' => Back\System\SettingsController::class.'@show']);
78 78
 
79
-    Route::post('notes/publish',['as' => 'notes.publish','uses' => Back\NoteController::class.'@publish']);
79
+    Route::post('notes/publish', ['as' => 'notes.publish', 'uses' => Back\NoteController::class.'@publish']);
80 80
     Route::resource('notes', Back\NoteController::class);
81 81
 
82 82
     /**
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
      * -----------------------------------------------------------------
119 119
      */
120 120
     // Developer access
121
-    Route::get('translations/lines/create',['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.create','uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@create']);
122
-    Route::delete('translations/lines/{id}',['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.destroy','uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@destroy']);
123
-    Route::get('translations/lines/{id}/edit',['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.edit','uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@edit']);
124
-    Route::put('translations/lines/{id}',['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.update','uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@update']);
125
-    Route::post('translations/lines',['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.store','uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@store']);
121
+    Route::get('translations/lines/create', ['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.create', 'uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@create']);
122
+    Route::delete('translations/lines/{id}', ['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.destroy', 'uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@destroy']);
123
+    Route::get('translations/lines/{id}/edit', ['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.edit', 'uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@edit']);
124
+    Route::put('translations/lines/{id}', ['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.update', 'uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@update']);
125
+    Route::post('translations/lines', ['middleware' => 'auth.superadmin', 'as' => 'squanto.lines.store', 'uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\LineController@store']);
126 126
 
127 127
     // Client access
128
-    Route::get('translations/{id}/edit',['as' => 'squanto.edit','uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\TranslationController@edit']);
129
-    Route::put('translations/{id}',['as' => 'squanto.update','uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\TranslationController@update']);
130
-    Route::get('translations',['as' => 'squanto.index','uses' => 'Back\TranslationController@index']);
128
+    Route::get('translations/{id}/edit', ['as' => 'squanto.edit', 'uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\TranslationController@edit']);
129
+    Route::put('translations/{id}', ['as' => 'squanto.update', 'uses' => '\Thinktomorrow\Squanto\Manager\Http\Controllers\TranslationController@update']);
130
+    Route::get('translations', ['as' => 'squanto.index', 'uses' => 'Back\TranslationController@index']);
131 131
 
132 132
 });
Please login to merge, or discard this patch.
resources/views/spirit/settings/typography.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php include(__DIR__ . '/../_partials/header.php'); ?>
1
+<?php include(__DIR__.'/../_partials/header.php'); ?>
2 2
 
3 3
 <section class="column stack-l typography" id="typography">
4 4
     <h1>Typography</h1>
@@ -62,4 +62,4 @@  discard block
 block discarded – undo
62 62
 
63 63
 </section>
64 64
 
65
-<?php include(__DIR__ . '/../_partials/footer.php'); ?>
65
+<?php include(__DIR__.'/../_partials/footer.php'); ?>
Please login to merge, or discard this patch.