Skip to content

Commit

Permalink
bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Oct 18, 2021
1 parent c7971b9 commit 1f15c7c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
11 changes: 6 additions & 5 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'@PSR12' => true,
'binary_operator_spaces' => true,
'blank_line_after_opening_tag' => true,
'compact_nullable_typehint' => true,
Expand All @@ -13,6 +13,7 @@
'no_blank_lines_after_class_opening' => true,
'no_leading_import_slash' => true,
'no_whitespace_in_blank_line' => true,
'no_unused_imports' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
Expand Down Expand Up @@ -42,7 +43,7 @@
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->in([__DIR__.'/src/', __DIR__.'/tests/'])
->exclude('vendor')
->in([__DIR__.'/src/', __DIR__.'/tests/'])
)
;
;
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"cghooks update"
],
"cghooks": "vendor/bin/cghooks",
"check-style": "php-cs-fixer fix --using-cache=no --diff --config=.php_cs --dry-run --ansi",
"fix-style": "php-cs-fixer fix --using-cache=no --config=.php_cs --ansi",
"check-style": "php-cs-fixer fix --using-cache=no --diff --dry-run --ansi",
"fix-style": "php-cs-fixer fix --using-cache=no --ansi",
"test": "vendor/bin/phpunit --colors=always"
},
"scripts-descriptions": {
Expand Down
3 changes: 1 addition & 2 deletions src/Traits/Liker.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function like(Model $object): Like
/* @var \Overtrue\LaravelLike\Traits\Likeable|\Illuminate\Database\Eloquent\Model $object */
return $like->where($attributes)->firstOr(
function () use ($like, $attributes) {
return $like->unguarded(function() use ($like, $attributes) {
return $like->unguarded(function () use ($like, $attributes) {
if ($this->relationLoaded('likes')) {
$this->unsetRelation('likes');
}
Expand Down Expand Up @@ -107,5 +107,4 @@ function ($q) {
}
);
}

}
1 change: 0 additions & 1 deletion tests/FeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Support\Facades\Event;
use Overtrue\LaravelLike\Events\Liked;
use Overtrue\LaravelLike\Events\Unliked;
use Overtrue\LaravelLike\Like;

class FeatureTest extends TestCase
{
Expand Down

0 comments on commit 1f15c7c

Please sign in to comment.