Completed
Push — master ( 375a11...881166 )
by Nicolas
14:02
created
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.
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.
Entities/BlockTranslation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 class BlockTranslation extends Model
9 9
 {
10 10
     public $timestamps = false;
11
-    protected $fillable = ['online', 'body'];
11
+    protected $fillable = [ 'online', 'body' ];
12 12
     protected $table = 'block__blocks_translations';
13 13
 
14 14
     public function getBodyAttribute($body)
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
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 use Illuminate\Routing\Router;
4 4
 
5 5
 /** @var Router $router */
6
-$router->bind('block', function ($id) {
6
+$router->bind('block', function($id) {
7 7
     return app(\Modules\Block\Repositories\BlockRepository::class)->find($id);
8 8
 });
9
-$router->group(['prefix' => '/block'], function (Router $router) {
9
+$router->group([ 'prefix' => '/block' ], function(Router $router) {
10 10
     $router->get('blocks', [
11 11
         'as' => 'admin.block.block.index',
12 12
         'uses' => 'BlockController@index',
Please login to merge, or discard this patch.
Tests/Integration/BlockContentIsRenderingTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
     /** @test */
11 11
     public function it_can_change_final_content()
12 12
     {
13
-        Event::listen(BlockContentIsRendering::class, function (BlockContentIsRendering $event) {
14
-            $event->setBody('<strong>' . $event->getOriginal() . '</strong>');
13
+        Event::listen(BlockContentIsRendering::class, function(BlockContentIsRendering $event) {
14
+            $event->setBody('<strong>'.$event->getOriginal().'</strong>');
15 15
         });
16 16
 
17
-        $block = $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'My Block Body'], 'fr' => ['body' => 'lorem fr']]);
17
+        $block = $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'My Block Body' ], 'fr' => [ 'body' => 'lorem fr' ] ]);
18 18
 
19 19
         $this->assertEquals('<strong>My Block Body</strong>', $block->body);
20 20
     }
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     /** @test */
23 23
     public function it_doesnt_alter_content_if_no_listeners()
24 24
     {
25
-        $block = $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'My Block Body'], 'fr' => ['body' => 'lorem fr']]);
25
+        $block = $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'My Block Body' ], 'fr' => [ 'body' => 'lorem fr' ] ]);
26 26
 
27 27
         $this->assertEquals('My Block Body', $block->body);
28 28
     }
Please login to merge, or discard this patch.
Tests/Integration/EloquentBlockRepositoryTest.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     /** @test */
17 17
     public function it_creates_blocks()
18 18
     {
19
-        $block = $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en'], 'fr' => ['body' => 'lorem fr']]);
19
+        $block = $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'lorem en' ], 'fr' => [ 'body' => 'lorem fr' ] ]);
20 20
         $blocks = $this->block->all();
21 21
 
22 22
         $this->assertCount(1, $blocks);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     /** @test */
46 46
     public function it_gets_block_by_name()
47 47
     {
48
-        $this->block->create(['name' => 'testblock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => true]]);
48
+        $this->block->create([ 'name' => 'testblock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => true ] ]);
49 49
         $this->createRandomBlock(true, true);
50 50
         $this->createRandomBlock(true, true);
51 51
         $this->createRandomBlock(true, true);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     /** @test */
59 59
     public function it_gets_block_by_name_if_online()
60 60
     {
61
-        $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]);
61
+        $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]);
62 62
         $this->createRandomBlock(true, true);
63 63
         $this->createRandomBlock(true, true);
64 64
         $this->createRandomBlock(true, true);
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     /** @test */
76 76
     public function it_gets_block_by_facade()
77 77
     {
78
-        $this->block->create(['name' => 'testblock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]);
78
+        $this->block->create([ 'name' => 'testblock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]);
79 79
         $this->createRandomBlock(true, true);
80 80
         $this->createRandomBlock(true, true);
81 81
 
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
     /** @test */
88 88
     public function it_slugifies_the_name_property()
89 89
     {
90
-        $block = $this->block->create(['name' => 'test block', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]);
90
+        $block = $this->block->create([ 'name' => 'test block', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]);
91 91
 
92 92
         $this->assertEquals('test-block', $block->name);
93 93
     }
94 94
 
95 95
     public function it_makes_name_unique()
96 96
     {
97
-        $this->block->create(['name' => 'test block']);
98
-        $block = $this->block->create(['name' => 'test block']);
97
+        $this->block->create([ 'name' => 'test block' ]);
98
+        $block = $this->block->create([ 'name' => 'test block' ]);
99 99
 
100 100
         $this->assertEquals('test-block-1', $block->name);
101 101
     }
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
     /** @test */
104 104
     public function it_increments_name_if_not_unique()
105 105
     {
106
-        $this->block->create(['name' => 'test block']);
107
-        $this->block->create(['name' => 'test block']);
108
-        $block1 = $this->block->create(['name' => 'test block']);
109
-        $block2 = $this->block->create(['name' => 'test block']);
106
+        $this->block->create([ 'name' => 'test block' ]);
107
+        $this->block->create([ 'name' => 'test block' ]);
108
+        $block1 = $this->block->create([ 'name' => 'test block' ]);
109
+        $block2 = $this->block->create([ 'name' => 'test block' ]);
110 110
 
111 111
         $this->assertEquals('test-block-2', $block1->name);
112 112
         $this->assertEquals('test-block-3', $block2->name);
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
     /** @test */
116 116
     public function it_updates_block_without_name_change()
117 117
     {
118
-        $block = $this->block->create(['name' => 'test block']);
119
-        $this->block->update($block, ['name' => 'test-block']);
118
+        $block = $this->block->create([ 'name' => 'test block' ]);
119
+        $this->block->update($block, [ 'name' => 'test-block' ]);
120 120
 
121 121
         $this->assertEquals($block->name, 'test-block');
122 122
     }
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
     /** @test */
125 125
     public function it_updates_block_with_name_change()
126 126
     {
127
-        $block = $this->block->create(['name' => 'test block']);
128
-        $this->block->update($block, ['name' => 'my awesome block']);
127
+        $block = $this->block->create([ 'name' => 'test block' ]);
128
+        $this->block->update($block, [ 'name' => 'my awesome block' ]);
129 129
 
130 130
         $this->assertEquals($block->name, 'my-awesome-block');
131 131
     }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
         $block = $this->createRandomBlock();
147 147
 
148
-        Event::assertDispatched(BlockWasCreated::class, function ($e) use ($block) {
148
+        Event::assertDispatched(BlockWasCreated::class, function($e) use ($block) {
149 149
             return $e->block->name === $block->name;
150 150
         });
151 151
     }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
         $block = $this->createRandomBlock();
159 159
 
160
-        Event::assertDispatched(BlockIsCreating::class, function ($e) use ($block) {
160
+        Event::assertDispatched(BlockIsCreating::class, function($e) use ($block) {
161 161
             return $e->getAttribute('name') === $block->name;
162 162
         });
163 163
     }
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
     /** @test */
166 166
     public function it_can_change_data_when_it_is_creating_event()
167 167
     {
168
-        Event::listen(BlockIsCreating::class, function (BlockIsCreating $event) {
169
-            $event->setAttributes(['name' => 'awesome block']);
168
+        Event::listen(BlockIsCreating::class, function(BlockIsCreating $event) {
169
+            $event->setAttributes([ 'name' => 'awesome block' ]);
170 170
             $event->setAttributes([
171
-                'en' => ['body' => 'no more lorem! en'],
172
-                'fr' => ['body' => 'no more lorem! fr'],
171
+                'en' => [ 'body' => 'no more lorem! en' ],
172
+                'fr' => [ 'body' => 'no more lorem! fr' ],
173 173
             ]);
174 174
         });
175 175
 
176
-        $block = $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en'], 'fr' => ['body' => 'lorem fr']]);
176
+        $block = $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'lorem en' ], 'fr' => [ 'body' => 'lorem fr' ] ]);
177 177
 
178 178
         $this->assertEquals('awesome block', $block->name);
179 179
         $this->assertEquals('no more lorem! en', $block->translate('en')->body);
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
         Event::fake();
187 187
 
188 188
         $block = $this->createRandomBlock();
189
-        $block = $this->block->update($block, ['name' => 'something else']);
189
+        $block = $this->block->update($block, [ 'name' => 'something else' ]);
190 190
 
191
-        Event::assertDispatched(BlockWasUpdated::class, function ($e) use ($block) {
191
+        Event::assertDispatched(BlockWasUpdated::class, function($e) use ($block) {
192 192
             return $e->block->name === $block->name;
193 193
         });
194 194
     }
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
         Event::fake();
200 200
 
201 201
         $block = $this->createRandomBlock();
202
-        $block = $this->block->update($block, ['name' => 'something else']);
202
+        $block = $this->block->update($block, [ 'name' => 'something else' ]);
203 203
 
204
-        Event::assertDispatched(BlockIsUpdating::class, function ($e) use ($block) {
204
+        Event::assertDispatched(BlockIsUpdating::class, function($e) use ($block) {
205 205
             return $e->getAttribute('name') === $block->name;
206 206
         });
207 207
     }
@@ -209,16 +209,16 @@  discard block
 block discarded – undo
209 209
     /** @test */
210 210
     public function it_can_change_data_when_it_is_updating_event()
211 211
     {
212
-        Event::listen(BlockIsUpdating::class, function (BlockIsUpdating $event) {
213
-            $event->setAttributes(['name' => 'awesome block']);
212
+        Event::listen(BlockIsUpdating::class, function(BlockIsUpdating $event) {
213
+            $event->setAttributes([ 'name' => 'awesome block' ]);
214 214
             $event->setAttributes([
215
-                'en' => ['body' => 'no more lorem! en'],
216
-                'fr' => ['body' => 'no more lorem! fr'],
215
+                'en' => [ 'body' => 'no more lorem! en' ],
216
+                'fr' => [ 'body' => 'no more lorem! fr' ],
217 217
             ]);
218 218
         });
219 219
 
220 220
         $block = $this->createRandomBlock();
221
-        $block = $this->block->update($block, ['name' => 'something else']);
221
+        $block = $this->block->update($block, [ 'name' => 'something else' ]);
222 222
 
223 223
         $this->assertEquals('awesome block', $block->name);
224 224
         $this->assertEquals('no more lorem! en', $block->translate('en')->body);
Please login to merge, or discard this patch.
Tests/Integration/BlockFacadeTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     /** @test */
10 10
     public function it_links_global_facade_to_repository()
11 11
     {
12
-        $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en'], 'fr' => ['body' => 'lorem fr']]);
12
+        $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'lorem en' ], 'fr' => [ 'body' => 'lorem fr' ] ]);
13 13
 
14 14
         $this->assertInstanceOf(Collection::class, \Block::all());
15 15
     }
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
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $this->registerBindings();
32 32
         $this->registerFacade();
33 33
 
34
-        $this->app['events']->listen(
34
+        $this->app[ 'events' ]->listen(
35 35
             BuildingSidebar::class,
36 36
             $this->getSidebarClassForModule('block', RegisterBlockSidebar::class)
37 37
         );
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $this->publishConfig('block', 'permissions');
43 43
         $this->publishConfig('block', 'config');
44
-        $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
44
+        $this->loadMigrationsFrom(__DIR__.'/../Database/Migrations');
45 45
     }
46 46
 
47 47
     /**
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $this->app->bind(
59 59
             'Modules\Block\Repositories\BlockRepository',
60
-            function () {
60
+            function() {
61 61
                 $repository = new EloquentBlockRepository(new Block());
62 62
 
63
-                if (! config('app.cache')) {
63
+                if (!config('app.cache')) {
64 64
                     return $repository;
65 65
                 }
66 66
 
Please login to merge, or discard this patch.
Events/Handlers/RegisterBlockSidebar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
      */
30 30
     public function extendWith(Menu $menu)
31 31
     {
32
-        $menu->group(trans('core::sidebar.content'), function (Group $group) {
33
-            $group->item(trans('block::blocks.title.blocks'), function (Item $item) {
32
+        $menu->group(trans('core::sidebar.content'), function(Group $group) {
33
+            $group->item(trans('block::blocks.title.blocks'), function(Item $item) {
34 34
                 $item->authorize(
35 35
                     $this->auth->hasAccess('block.blocks.index')
36 36
                 );
Please login to merge, or discard this patch.