We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -12,12 +12,18 @@ |
||
12 | 12 | |-------------------------------------------------------------------------- |
13 | 13 | */ |
14 | 14 | |
15 | + /** |
|
16 | + * @param string $access |
|
17 | + */ |
|
15 | 18 | public function allowAccess($access) |
16 | 19 | { |
17 | 20 | // $this->addButtons((array)$access); |
18 | 21 | return $this->access = array_merge(array_diff((array) $access, $this->access), $this->access); |
19 | 22 | } |
20 | 23 | |
24 | + /** |
|
25 | + * @param string $access |
|
26 | + */ |
|
21 | 27 | public function denyAccess($access) |
22 | 28 | { |
23 | 29 | // $this->removeButtons((array)$access); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function hasAccess($permission) |
35 | 35 | { |
36 | - if (! in_array($permission, $this->access)) { |
|
36 | + if (!in_array($permission, $this->access)) { |
|
37 | 37 | return false; |
38 | 38 | } |
39 | 39 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function hasAccessToAll($permission_array) |
69 | 69 | { |
70 | 70 | foreach ($permission_array as $key => $permission) { |
71 | - if (! in_array($permission, $this->access)) { |
|
71 | + if (!in_array($permission, $this->access)) { |
|
72 | 72 | return false; |
73 | 73 | } |
74 | 74 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function hasAccessOrFail($permission) |
88 | 88 | { |
89 | - if (! in_array($permission, $this->access)) { |
|
89 | + if (!in_array($permission, $this->access)) { |
|
90 | 90 | throw new AccessDeniedException(trans('backpack::crud.unauthorized_access', ['access' => $permission])); |
91 | 91 | } |
92 | 92 |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\Tests\Unit\CrudPanel; |
4 | 4 | |
5 | -use Faker\Factory; |
|
6 | -use Backpack\CRUD\Tests\Unit\Models\User; |
|
7 | 5 | use Backpack\CRUD\Tests\Unit\Models\Article; |
6 | +use Backpack\CRUD\Tests\Unit\Models\User; |
|
7 | +use Faker\Factory; |
|
8 | 8 | |
9 | 9 | class CrudPanelCreateTest extends BaseDBCrudPanelTest |
10 | 10 | { |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\Tests\Unit\CrudPanel; |
4 | 4 | |
5 | -use Illuminate\Support\Facades\DB; |
|
6 | 5 | use Backpack\CRUD\Tests\Unit\Models\Article; |
7 | 6 | use Illuminate\Database\Eloquent\ModelNotFoundException; |
7 | +use Illuminate\Support\Facades\DB; |
|
8 | 8 | |
9 | 9 | class CrudPanelDeleteTest extends BaseDBCrudPanelTest |
10 | 10 | { |
@@ -2,11 +2,11 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\Tests\Unit\CrudPanel; |
4 | 4 | |
5 | -use Illuminate\Support\Collection; |
|
6 | -use Illuminate\Support\Facades\DB; |
|
7 | -use Backpack\CRUD\Tests\Unit\Models\User; |
|
8 | 5 | use Backpack\CRUD\Tests\Unit\Models\Article; |
6 | +use Backpack\CRUD\Tests\Unit\Models\User; |
|
9 | 7 | use Illuminate\Database\Eloquent\ModelNotFoundException; |
8 | +use Illuminate\Support\Collection; |
|
9 | +use Illuminate\Support\Facades\DB; |
|
10 | 10 | |
11 | 11 | class CrudPanelReadTest extends BaseDBCrudPanelTest |
12 | 12 | { |
@@ -13,13 +13,13 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('roles', function (Blueprint $table) { |
|
16 | + Schema::create('roles', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('name')->unique(); |
19 | 19 | $table->timestamps(); |
20 | 20 | }); |
21 | 21 | |
22 | - Schema::create('user_role', function (Blueprint $table) { |
|
22 | + Schema::create('user_role', function(Blueprint $table) { |
|
23 | 23 | $table->integer('user_id')->length(10)->unsigned(); |
24 | 24 | $table->integer('role_id')->length(10)->unsigned(); |
25 | 25 | $table->timestamps(); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('addresses', function (Blueprint $table) { |
|
16 | + Schema::create('addresses', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('account_details_id')->length(10)->unsigned(); |
19 | 19 | $table->string('city'); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('articles', function ($table) { |
|
15 | + Schema::create('articles', function($table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->integer('user_id')->length(10)->unsigned(); |
18 | 18 | $table->string('content'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('account_details', function (Blueprint $table) { |
|
16 | + Schema::create('account_details', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('user_id')->length(10)->unsigned(); |
19 | 19 | $table->string('nickname'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('users', function (Blueprint $table) { |
|
16 | + Schema::create('users', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('name'); |
19 | 19 | $table->string('email')->unique(); |