Skip to content

Commit

Permalink
Merge pull request #32 from spatie/analysis-qJWJgb
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
freekmurze authored Mar 14, 2018
2 parents 05941c9 + 0f3b994 commit 0579c89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Events/StatusUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Spatie\ModelStatus\Events;

use Illuminate\Database\Eloquent\Model;
use Spatie\ModelStatus\Status;
use Illuminate\Database\Eloquent\Model;

class StatusUpdated
{
Expand Down
11 changes: 5 additions & 6 deletions src/HasStatuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

namespace Spatie\ModelStatus;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Builder;
use Spatie\ModelStatus\Events\StatusUpdated;
use Spatie\ModelStatus\Exceptions\InvalidStatus;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Query\Builder as QueryBuilder;

trait HasStatuses
{

public function statuses(): MorphMany
{
return $this->morphMany($this->getStatusModelClassName(), 'model')->latest();
Expand All @@ -24,7 +23,7 @@ public function status(): ?Status

public function setStatus(string $name, string $reason = ''): self
{
if (!$this->isValidStatus($name, $reason)) {
if (! $this->isValidStatus($name, $reason)) {
throw InvalidStatus::create($name);
}

Expand Down Expand Up @@ -97,7 +96,7 @@ function (QueryBuilder $query) use ($names) {

public function getStatusAttribute(): string
{
return (string)$this->latestStatus();
return (string) $this->latestStatus();
}

public function forceSetStatus(string $name, string $reason = ''): self
Expand Down
4 changes: 2 additions & 2 deletions tests/Events/StatusEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace Spatie\ModelStatus\Tests\Events;

use Illuminate\Support\Facades\Event;
use Spatie\ModelStatus\Tests\TestCase;
use Spatie\ModelStatus\Events\StatusUpdated;
use Spatie\ModelStatus\Tests\Models\TestModel;
use Spatie\ModelStatus\Tests\TestCase;

class StatusUpdatedTest extends TestCase
class StatusEventsTest extends TestCase
{
/** @var \Spatie\ModelStatus\Tests\Models\TestModel */
protected $testModel;
Expand Down

0 comments on commit 0579c89

Please sign in to comment.