Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #45

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading