Skip to content

Commit

Permalink
Apply fixes from StyleCI (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkp22 authored Mar 9, 2020
1 parent ff2d06d commit 6272788
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions migrations/2018_06_25_000000_create_bans_table.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBansTable extends Migration
{
Expand Down
2 changes: 1 addition & 1 deletion src/Events/ModelWasBanned.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Qirolab\Laravel\Bannable\Events;

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Model;
use Qirolab\Laravel\Bannable\Models\Ban;
use Illuminate\Contracts\Queue\ShouldQueue;

class ModelWasBanned implements ShouldQueue
{
Expand Down
2 changes: 1 addition & 1 deletion src/Events/ModelWasUnbanned.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Qirolab\Laravel\Bannable\Events;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Model;

class ModelWasUnbanned implements ShouldQueue
{
Expand Down
4 changes: 2 additions & 2 deletions src/Middleware/ForbidBannedUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public function handle($request, Closure $next)
try {
if ($user && $user->isBanned()) {
return redirect()->back()->withInput()->withErrors([
'login' => 'This account is blocked.',
]);
'login' => 'This account is blocked.',
]);
}
} catch (\BadMethodCallException $e) {
throw new BannableTraitNotUsed($user);
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Ban.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Qirolab\Laravel\Bannable\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Qirolab\Laravel\Bannable\Scopes\BannedModelScope;

Expand Down
2 changes: 1 addition & 1 deletion src/Observers/BanObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Qirolab\Laravel\Bannable\Observers;

use Qirolab\Laravel\Bannable\Models\Ban;
use Qirolab\Laravel\Bannable\Events\ModelWasBanned;
use Qirolab\Laravel\Bannable\Events\ModelWasUnbanned;
use Qirolab\Laravel\Bannable\Models\Ban;

class BanObserver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Scopes/BannedModelScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Qirolab\Laravel\Bannable\Scopes;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
use Illuminate\Database\Eloquent\Builder;

class BannedModelScope implements Scope
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Qirolab\Tests\Laravel\Bannable\Stubs\Models;

use Qirolab\Laravel\Bannable\Traits\Bannable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Qirolab\Laravel\Bannable\Traits\Bannable;

class User extends Authenticatable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ private function registerPackageFactories()

$this->withFactories($pathToFactories);
}
}
}
4 changes: 2 additions & 2 deletions tests/Unit/BanExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Qirolab\Tests\Laravel\Bannable\Unit;

use Illuminate\Http\Request;
use Qirolab\Tests\Laravel\Bannable\TestCase;
use Qirolab\Laravel\Bannable\Middleware\ForbidBannedUser;
use Qirolab\Laravel\Bannable\Exceptions\BannableTraitNotUsed;
use Qirolab\Laravel\Bannable\Middleware\ForbidBannedUser;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\UserWithoutBannableTrait;
use Qirolab\Tests\Laravel\Bannable\TestCase;

class BanExceptionTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/BanMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Qirolab\Tests\Laravel\Bannable\Unit;

use Illuminate\Http\Request;
use Qirolab\Tests\Laravel\Bannable\TestCase;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User;
use Qirolab\Laravel\Bannable\Middleware\ForbidBannedUser;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User;
use Qirolab\Tests\Laravel\Bannable\TestCase;

class BanMiddlewareTest extends TestCase
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/BanModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Carbon\Carbon;
use Qirolab\Laravel\Bannable\Models\Ban;
use Qirolab\Tests\Laravel\Bannable\TestCase;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User;
use Qirolab\Tests\Laravel\Bannable\TestCase;

class BanModelTest extends TestCase
{
Expand Down Expand Up @@ -75,9 +75,9 @@ public function it_can_has_bannable_model()
$user = factory(User::class)->create();

$ban = factory(Ban::class)->create([
'bannable_id' => $user->getKey(),
'bannable_type' => $user->getMorphClass(),
]);
'bannable_id' => $user->getKey(),
'bannable_type' => $user->getMorphClass(),
]);

$this->assertInstanceOf(User::class, $ban->bannable);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/BanObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Carbon\Carbon;
use Qirolab\Laravel\Bannable\Models\Ban;
use Qirolab\Tests\Laravel\Bannable\TestCase;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User;
use Qirolab\Tests\Laravel\Bannable\TestCase;

class BanObserverTest extends TestCase
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/BannableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Carbon\Carbon;
use Qirolab\Laravel\Bannable\Models\Ban;
use Qirolab\Tests\Laravel\Bannable\TestCase;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User;
use Qirolab\Tests\Laravel\Bannable\TestCase;

class BannableTest extends TestCase
{
Expand Down Expand Up @@ -78,12 +78,12 @@ public function model_can_unban()
public function model_can_soft_delete_ban_on_unban()
{
$user = factory(User::class)->create([
'banned_at' => Carbon::now(),
'banned_at' => Carbon::now(),
]);

factory(Ban::class)->create([
'bannable_id' => $user->getKey(),
'bannable_type' => $user->getMorphClass(),
'bannable_id' => $user->getKey(),
'bannable_type' => $user->getMorphClass(),
]);

$this->assertCount(1, $user->bans);
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/BannedScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Qirolab\Tests\Laravel\Bannable\Unit;

use Carbon\Carbon;
use Qirolab\Tests\Laravel\Bannable\TestCase;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\UserModelWithDisabledBannedScope;
use Qirolab\Tests\Laravel\Bannable\TestCase;

class BannedScopeTest extends TestCase
{
Expand Down Expand Up @@ -61,12 +61,12 @@ public function it_can_get_models_with_banned()
public function it_can_get_only_banned_models()
{
factory(User::class, 2)->create([
'banned_at' => Carbon::now()->subDay(),
]);
'banned_at' => Carbon::now()->subDay(),
]);

factory(User::class, 3)->create([
'banned_at' => null,
]);
'banned_at' => null,
]);

$entities = User::onlyBanned()->get();

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ModelBannedEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Qirolab\Tests\Laravel\Bannable\Unit;

use Qirolab\Tests\Laravel\Bannable\TestCase;
use Qirolab\Laravel\Bannable\Events\ModelWasBanned;
use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User;
use Qirolab\Tests\Laravel\Bannable\TestCase;

class ModelBannedEventTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ModelUnbannedEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Qirolab\Tests\Laravel\Bannable\Unit;

use Qirolab\Laravel\Bannable\Events\ModelWasUnbanned;
use Qirolab\Laravel\Bannable\Models\Ban;
use Qirolab\Tests\Laravel\Bannable\TestCase;
use Qirolab\Laravel\Bannable\Events\ModelWasUnbanned;

class ModelUnbannedEventTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserTable extends Migration
{
Expand Down

0 comments on commit 6272788

Please sign in to comment.