Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-layson committed Mar 5, 2024
1 parent 76bffce commit bfde97b
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/Commands/MakeUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function handle()

return false;
}

$userModelClass = config('auth.providers.users.model');
$userModel = new $userModelClass;
$userModel = new $userModelClass();
$userFieldsRaw = Schema::getColumnListing($userModel->getTable());

$excludeFields = ['id', 'created_at', 'updated_at', 'deleted_at', 'remember_token', 'email_verified_at'];
Expand All @@ -51,11 +51,11 @@ public function handle()
if ($dryRun) {
$this->info('User to be created');
$this->info($userModel);
return TRUE;
return true;
} else {
$this->info('User created');
$userModel->save();
return TRUE;
return true;
}
}
}
1 change: 0 additions & 1 deletion src/Models/AbstractContentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Portable\FilaCms\Models;

use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/MakeUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function test_roles_created(): void
{
$userModel = config('auth.providers.users.model');

$userFieldsRaw = Schema::getColumnListing((new $userModel)->getTable());
$userFieldsRaw = Schema::getColumnListing((new $userModel())->getTable());

$excludeFields = [ 'id', 'created_at', 'updated_at', 'deleted_at', 'remember_token', 'email_verified_at' ];
$userFields = array_diff($userFieldsRaw, $excludeFields);
Expand Down
4 changes: 2 additions & 2 deletions tests/Filament/AuthorResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ protected function setUp(): void

$this->artisan('db:seed', ['--class' => '\\Portable\\FilaCms\\Database\\Seeders\\RoleAndPermissionSeeder']);
$adminRole = Role::where('name', 'Admin')->first();

$userModel = config('auth.providers.users.model');

$adminUser = (new $userModel)->create([
$adminUser = (new $userModel())->create([
'name' => 'Test',
'email' => '[email protected]',
'password' => 'password'
Expand Down
1 change: 0 additions & 1 deletion tests/Filament/PageResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Portable\FilaCms\Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Portable\FilaCms\Filament\Resources\PageResource as TargetResource;
use Portable\FilaCms\Tests\User;
use Portable\FilaCms\Models\Page as TargetModel;
use Spatie\Permission\Models\Role;
use Portable\FilaCms\Models\Author;
Expand Down
1 change: 0 additions & 1 deletion tests/Filament/PermissionResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Portable\FilaCms\Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Portable\FilaCms\Filament\Resources\PermissionResource as TargetResource;
use Portable\FilaCms\Tests\User;
use Spatie\Permission\Models\Permission as TargetModel;
use Spatie\Permission\Models\Role;
use Livewire\Livewire;
Expand Down
1 change: 0 additions & 1 deletion tests/Filament/RoleResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Portable\FilaCms\Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Portable\FilaCms\Filament\Resources\RoleResource as TargetResource;
use Portable\FilaCms\Tests\User;
use Spatie\Permission\Models\Role as TargetModel;
use Spatie\Permission\Models\Role;
use Livewire\Livewire;
Expand Down
1 change: 0 additions & 1 deletion tests/Filament/TaxonomyResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Portable\FilaCms\Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Portable\FilaCms\Filament\Resources\TaxonomyResource as TargetResource;
use Portable\FilaCms\Tests\User;
use Portable\FilaCms\Models\Taxonomy as TargetModel;
use Spatie\Permission\Models\Role;
use Livewire\Livewire;
Expand Down
3 changes: 1 addition & 2 deletions tests/Filament/UserResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Portable\FilaCms\Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Portable\FilaCms\Filament\Resources\UserResource;
use Portable\FilaCms\Tests\User;
use Spatie\Permission\Models\Role;
use Livewire\Livewire;

Expand Down Expand Up @@ -41,7 +40,7 @@ public function test_can_list_users(): void
{
$users = [];

for ($i=0; $i < 5; $i++) {
for ($i = 0; $i < 5; $i++) {
$users[] = $this->createUser();
}

Expand Down
3 changes: 1 addition & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Illuminate\Support\Facades\File;
use Orchestra\Testbench\Attributes\WithMigration;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Portable\FilaCms\Tests\User;

#[WithMigration]
abstract class TestCase extends \Orchestra\Testbench\TestCase
Expand Down Expand Up @@ -60,7 +59,7 @@ protected function getPackageProviders($app)
{
$packages = parent::getPackageProviders($app);
$packages[] = \RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider::class;

return $packages;
}

Expand Down
1 change: 0 additions & 1 deletion tests/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable implements \Filament\Models\Contracts\FilamentUser
{
Expand Down
1 change: 0 additions & 1 deletion workbench/database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Workbench\Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
Expand Down

0 comments on commit bfde97b

Please sign in to comment.