Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Jun 11, 2024
1 parent 8ddf93f commit 39de88f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/Traits/Reactable.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function scopeWhereReactedBy(Builder $query, $userId = null, $type = null
try {
$user = $this->getUser($userId);
} catch (InvalidReactionUser $e) {
if (!$user && !$userId) {
if (! $user && ! $userId) {
throw InvalidReactionUser::notDefined();
}
}
Expand All @@ -223,15 +223,15 @@ public function scopeWhereReactedBy(Builder $query, $userId = null, $type = null
*/
private function getUser($user = null)
{
if (!$user && auth()->check()) {
if (! $user && auth()->check()) {
return auth()->user();
}

if ($user instanceof ReactsInterface) {
return $user;
}

if (!$user) {
if (! $user) {
throw InvalidReactionUser::notDefined();
}

Expand Down
6 changes: 3 additions & 3 deletions src/Traits/Reacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function reactTo(ReactableInterface $reactable, $type)
Helper::resolveReactsIdColumn() => $this->getKey(),
])->first();

if (!$reaction) {
if (! $reaction) {
return $this->storeReaction($reactable, $type);
}

Expand All @@ -48,7 +48,7 @@ public function removeReactionFrom(ReactableInterface $reactable)
Helper::resolveReactsIdColumn() => $this->getKey(),
])->first();

if (!$reaction) {
if (! $reaction) {
return;
}

Expand All @@ -68,7 +68,7 @@ public function toggleReactionOn(ReactableInterface $reactable, $type)
Helper::resolveReactsIdColumn() => $this->getKey(),
])->first();

if (!$reaction) {
if (! $reaction) {
return $this->storeReaction($reactable, $type);
}

Expand Down
8 changes: 4 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function publishPackageMigrations()
*/
protected function destroyPackageMigrations()
{
File::cleanDirectory(__DIR__ . '/../vendor/orchestra/testbench-core/laravel/database/migrations');
File::cleanDirectory(__DIR__.'/../vendor/orchestra/testbench-core/laravel/database/migrations');
}

/**
Expand Down Expand Up @@ -84,9 +84,9 @@ protected function getPackageProviders($app)
*/
protected function setUpDatabase()
{
include_once __DIR__ . '/../migrations/2018_07_10_000000_create_reactions_table.php';
include_once __DIR__ . '/database/migrations/2018_07_10_000000_create_users_table.php';
include_once __DIR__ . '/database/migrations/2018_07_11_000000_create_articles_table.php';
include_once __DIR__.'/../migrations/2018_07_10_000000_create_reactions_table.php';
include_once __DIR__.'/database/migrations/2018_07_10_000000_create_users_table.php';
include_once __DIR__.'/database/migrations/2018_07_11_000000_create_articles_table.php';

(new \CreateReactionsTable())->up();
(new \CreateUsersTable())->up();
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/ReactsProfileModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
class ReactsProfileModelTest extends TestCase
{
/**
* Actions to be performed on PHPUnit start.
*
* @return void
*/
* Actions to be performed on PHPUnit start.
*
* @return void
*/
protected function setUp(): void
{
parent::setUp();
Expand Down

0 comments on commit 39de88f

Please sign in to comment.