Completed
Push — master ( 188479 )
by Nicolas
19:33 queued 17:46
created
Repositories/Eloquent/EloquentBlockRepository.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
     /**
13 13
      * @param mixed $data
14
-     * @return mixed
14
+     * @return \Illuminate\Database\Eloquent\Model
15 15
      */
16 16
     public function create($data)
17 17
     {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     }
177 177
 
178 178
     /**
179
-     * @return mixed
179
+     * @return integer
180 180
      */
181 181
     private function findHighestIncrement($list)
182 182
     {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function allOnlineInLang($lang)
51 51
     {
52
-        return $this->model->whereHas('translations', function (Builder $q) use ($lang) {
52
+        return $this->model->whereHas('translations', function(Builder $q) use ($lang) {
53 53
             $q->where('locale', "$lang");
54 54
             $q->where('online', true);
55 55
         })->with('translations')->orderBy('created_at', 'DESC')->get();
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $lang = $this->getCurrentLocale();
66 66
 
67
-        $block = $this->model->whereHas('translations', function (Builder $q) use ($lang) {
67
+        $block = $this->model->whereHas('translations', function(Builder $q) use ($lang) {
68 68
             $q->where('locale', "$lang");
69 69
             $q->where('online', true);
70 70
         })->with('translations')->whereName($name)->first();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     private function sluggify(array &$data)
89 89
     {
90
-        $data['name'] = $this->makeNameUnique($data['name']);
90
+        $data[ 'name' ] = $this->makeNameUnique($data[ 'name' ]);
91 91
     }
92 92
 
93 93
     /**
@@ -103,20 +103,20 @@  discard block
 block discarded – undo
103 103
 
104 104
         if (
105 105
             $this->isEmptyArray($list) ||
106
-            ! $this->isSlugInList($slug, $list) ||
106
+            !$this->isSlugInList($slug, $list) ||
107 107
             ($this->isForModel($list) && $this->slugIsInList($slug, $list))
108 108
         ) {
109 109
             return $slug;
110 110
         }
111 111
 
112 112
         // map our list to keep only the increments
113
-        $len = strlen($slug . '-');
113
+        $len = strlen($slug.'-');
114 114
 
115
-        array_walk($list, function (&$value, $key) use ($len) {
115
+        array_walk($list, function(&$value, $key) use ($len) {
116 116
             $value = intval(substr($value, $len));
117 117
         });
118 118
 
119
-        return $slug . '-' . $this->findHighestIncrement($list);
119
+        return $slug.'-'.$this->findHighestIncrement($list);
120 120
     }
121 121
 
122 122
     /**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     private function getExistingSlugs($slug)
128 128
     {
129
-        $query = $this->model->where('name', 'LIKE', $slug . '%');
129
+        $query = $this->model->where('name', 'LIKE', $slug.'%');
130 130
 
131 131
         $list = $query->lists('name', $this->model->getKeyName())->toArray();
132 132
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     private function slugIsInList($slug, array $list)
174 174
     {
175
-        return $list[$this->model->getKey()] === $slug;
175
+        return $list[ $this->model->getKey() ] === $slug;
176 176
     }
177 177
 
178 178
     /**
Please login to merge, or discard this patch.
Entities/Block.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 
11 11
     protected $presenter = 'Modules\Block\Presenters\BlockPresenter';
12 12
     protected $table = 'block__blocks';
13
-    public $translatedAttributes = ['online', 'body'];
14
-    protected $fillable = ['name', 'online', 'body'];
13
+    public $translatedAttributes = [ 'online', 'body' ];
14
+    protected $fillable = [ 'name', 'online', 'body' ];
15 15
     protected $casts = [
16 16
         'online' => 'bool',
17 17
     ];
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function __call($method, $parameters)
20 20
     {
21 21
         #i: Convert array to dot notation
22
-        $config = implode('.', ['asgard.block.config.relations', $method]);
22
+        $config = implode('.', [ 'asgard.block.config.relations', $method ]);
23 23
 
24 24
         #i: Relation method resolver
25 25
         if (config()->has($config)) {
Please login to merge, or discard this patch.
Tests/Integration/BaseBlockTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@
 block discarded – undo
45 45
 
46 46
     protected function getEnvironmentSetUp($app)
47 47
     {
48
-        $app['path.base'] = __DIR__ . '/..';
49
-        $app['config']->set('database.default', 'sqlite');
50
-        $app['config']->set('database.connections.sqlite', array(
48
+        $app[ 'path.base' ] = __DIR__.'/..';
49
+        $app[ 'config' ]->set('database.default', 'sqlite');
50
+        $app[ 'config' ]->set('database.connections.sqlite', array(
51 51
             'driver' => 'sqlite',
52 52
             'database' => ':memory:',
53 53
             'prefix' => '',
54 54
         ));
55
-        $app['config']->set('translatable.locales', ['en', 'fr']);
55
+        $app[ 'config' ]->set('translatable.locales', [ 'en', 'fr' ]);
56 56
     }
57 57
 
58 58
     private function resetDatabase()
Please login to merge, or discard this patch.
Providers/BlockServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function boot()
28 28
     {
29
-        $this->mergeConfigFrom(__DIR__ . '/../Config/config.php', 'asgard.block.config');
30
-        $this->publishes([__DIR__ . '/../Config/config.php' => config_path('asgard.block.config' . '.php'), ], 'config');
29
+        $this->mergeConfigFrom(__DIR__.'/../Config/config.php', 'asgard.block.config');
30
+        $this->publishes([ __DIR__.'/../Config/config.php' => config_path('asgard.block.config'.'.php'), ], 'config');
31 31
     }
32 32
 
33 33
     /**
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $this->app->bind(
45 45
             'Modules\Block\Repositories\BlockRepository',
46
-            function () {
46
+            function() {
47 47
                 $repository = new EloquentBlockRepository(new Block());
48 48
 
49
-                if (! config('app.cache')) {
49
+                if (!config('app.cache')) {
50 50
                     return $repository;
51 51
                 }
52 52
 
Please login to merge, or discard this patch.
Http/backendRoutes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 /** @var Router $router */
6 6
 
7
-$router->bind('block', function ($id) {
7
+$router->bind('block', function($id) {
8 8
     return app(\Modules\Block\Repositories\BlockRepository::class)->find($id);
9 9
 });
10
-$router->group(['prefix' => '/block'], function (Router $router) {
10
+$router->group([ 'prefix' => '/block' ], function(Router $router) {
11 11
     $router->get('blocks', [
12 12
         'as' => 'admin.block.block.index',
13 13
         'uses' => 'BlockController@index',
Please login to merge, or discard this patch.
Http/Requests/UpdateBlockRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,6 +32,6 @@
 block discarded – undo
32 32
 
33 33
     public function messages()
34 34
     {
35
-        return [];
35
+        return [ ];
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
Repositories/Cache/CacheBlockDecorator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         return $this->cache
23 23
             ->tags($this->entityName, 'global')
24 24
             ->remember("{$this->locale}.{$this->entityName}.allOnlineInLang", $this->cacheTime,
25
-                function () use ($lang) {
25
+                function() use ($lang) {
26 26
                     return $this->repository->allOnlineInLang($lang);
27 27
                 }
28 28
             );
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         return $this->cache
39 39
             ->tags($this->entityName, 'global')
40 40
             ->remember("{$this->locale}.{$this->entityName}.get.{$name}", $this->cacheTime,
41
-                function () use ($name) {
41
+                function() use ($name) {
42 42
                     return $this->repository->get($name);
43 43
                 }
44 44
             );
Please login to merge, or discard this patch.
Config/config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@
 block discarded – undo
10 10
     */
11 11
     'partials' => [
12 12
         'translatable' => [
13
-            'create' => [],
14
-            'edit' => [],
13
+            'create' => [ ],
14
+            'edit' => [ ],
15 15
         ],
16 16
         'normal' => [
17
-            'create' => [],
18
-            'edit' => [],
17
+            'create' => [ ],
18
+            'edit' => [ ],
19 19
         ],
20 20
     ],
21 21
 
Please login to merge, or discard this patch.