Skip to content

Commit

Permalink
Merge pull request #191 from jeremykenedy/analysis-KoB45Q
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
jeremykenedy authored Feb 4, 2023
2 parents 8c14796 + 89921a8 commit 7b14175
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/Database/Seeders/DefaultConnectRelationshipsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public function run()
$roleAdmin = config('roles.models.role')::where('slug', '=', 'admin')->first()
?? config('roles.models.role')::where('name', '=', 'Admin')->first();

$this->command->getOutput()->writeln("<info>Seeding:</info> DefaultConnectRelationshipsSeeder");
$this->command->getOutput()->writeln('<info>Seeding:</info> DefaultConnectRelationshipsSeeder');
foreach ($permissions as $permission) {
$roleAdmin->attachPermission($permission);
$this->command->getOutput()->writeln(
"<info>Seeding:</info> DefaultConnectRelationshipsSeeder - Role:Admin attached to Permission:"
. $permission->slug
'<info>Seeding:</info> DefaultConnectRelationshipsSeeder - Role:Admin attached to Permission:'
.$permission->slug
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Database/Seeders/DefaultPermissionsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function run()
* Add Permission Items
*
*/
$this->command->getOutput()->writeln("<info>Seeding:</info> DefaultPermissionitemsTableSeeder");
$this->command->getOutput()->writeln('<info>Seeding:</info> DefaultPermissionitemsTableSeeder');
foreach ($Permissionitems as $Permissionitem) {
$newPermissionitem = config('roles.models.permission')::where('slug', '=', $Permissionitem['slug'])
->first();
Expand All @@ -60,8 +60,8 @@ public function run()
'model' => $Permissionitem['model'],
]);
$this->command->getOutput()->writeln(
"<info>Seeding:</info> DefaultPermissionitemsTableSeeder - Permission:"
. $Permissionitem['slug']
'<info>Seeding:</info> DefaultPermissionitemsTableSeeder - Permission:'
.$Permissionitem['slug']
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Seeders/DefaultRolesTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function run()
* Add Role Items
*
*/
$this->command->getOutput()->writeln("<info>Seeding:</info> DefaultRoleItemsTableSeeder");
$this->command->getOutput()->writeln('<info>Seeding:</info> DefaultRoleItemsTableSeeder');
foreach ($RoleItems as $RoleItem) {
$newRoleItem = config('roles.models.role')::where('slug', '=', $RoleItem['slug'])->first();
if ($newRoleItem === null) {
Expand All @@ -53,7 +53,7 @@ public function run()
'level' => $RoleItem['level'],
]);
$this->command->getOutput()->writeln(
"<info>Seeding:</info> DefaultRoleItemsTableSeeder - Role:" . $RoleItem['slug']
'<info>Seeding:</info> DefaultRoleItemsTableSeeder - Role:'.$RoleItem['slug']
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Database/Seeders/DefaultUsersTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function run()
* Add Users
*
*/
$this->command->getOutput()->writeln("<info>Seeding:</info> DefaultUsersTableSeeder");
$this->command->getOutput()->writeln('<info>Seeding:</info> DefaultUsersTableSeeder');

if (config('roles.models.defaultUser')::where('email', '=', '[email protected]')->first() === null) {
$newUser = config('roles.models.defaultUser')::create([
Expand All @@ -35,7 +35,7 @@ public function run()
$newUser->attachPermission($permission);
}
$this->command->getOutput()->writeln(
"<info>Seeding:</info> DefaultUsersTableSeeder - User:[email protected]"
'<info>Seeding:</info> DefaultUsersTableSeeder - User:[email protected]'
);
}

Expand All @@ -47,7 +47,7 @@ public function run()
]);

$newUser->attachRole($userRole);
$this->command->getOutput()->writeln("<info>Seeding:</info> DefaultUsersTableSeeder - User:[email protected]");
$this->command->getOutput()->writeln('<info>Seeding:</info> DefaultUsersTableSeeder - User:[email protected]');
}
}
}
1 change: 0 additions & 1 deletion src/RolesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ private function loadSeedsFrom()
);
}
});

}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/RefreshDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ protected function migrateUsing()
{
return [
/**
* Non standard path
* Non standard path.
*
* $this->laravel->databasePath().DIRECTORY_SEPARATOR.'migrations'
* with `vendor/orchestra/testbench-core/laravel` as basePath
*
* @see \Illuminate\Database\Console\Migrations\BaseCommand
*/
'--path' => realpath(__DIR__ . '/../src/Database/Migrations'),
'--path' => realpath(__DIR__.'/../src/Database/Migrations'),
'--realpath' => true,
];
}
Expand Down
8 changes: 4 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestCase extends OrchestraTestCase
/**
* Get package providers.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
*
* @return array<int, class-string>
*/
Expand All @@ -24,7 +24,7 @@ protected function getPackageProviders($app)
/**
* Get package aliases.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
*
* @return array<string, class-string>
*/
Expand All @@ -38,7 +38,7 @@ protected function getPackageAliases($app)
/**
* Define environment setup.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
*
* @return void
*/
Expand All @@ -48,7 +48,7 @@ public function getEnvironmentSetUp($app)
return new SeedHandler($app, collect());
});

include_once __DIR__ . '/../src/Database/TestMigrations/create_users_table.php';
include_once __DIR__.'/../src/Database/TestMigrations/create_users_table.php';

(new \jeremykenedy\LaravelRoles\Database\TestMigrations\CreateUsersTable())->up();
}
Expand Down
6 changes: 3 additions & 3 deletions tests/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace jeremykenedy\LaravelRoles\Test;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\Access\Authorizable;
use jeremykenedy\LaravelRoles\Traits\HasRoleAndPermission;

class User extends Model implements AuthorizableContract, AuthenticatableContract
Expand Down

0 comments on commit 7b14175

Please sign in to comment.