Skip to content

Commit 1a862c7

Browse files
committed
resolve psalm issue
1 parent 79bf629 commit 1a862c7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Console/ModelsCommand.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
use Illuminate\Contracts\Database\Eloquent\Castable;
2626
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
2727
use Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes;
28-
use Illuminate\Database\Eloquent\Attributes\Scope;
2928
use Illuminate\Database\Eloquent\Casts\AsArrayObject;
3029
use Illuminate\Database\Eloquent\Casts\AsCollection;
3130
use Illuminate\Database\Eloquent\Casts\AsEnumCollection;
@@ -670,8 +669,8 @@ public function getPropertiesFromMethods($model)
670669
$comment = $this->getCommentFromDocBlock($reflection);
671670
$this->setProperty($name, null, null, true, $comment);
672671
}
673-
} elseif (class_exists(Scope::class) && !empty($reflection->getAttributes(Scope::class)) || (Str::startsWith($method, 'scope') && $method !== 'scopeQuery' && $method !== 'scope' && $method !== 'scopes')) {
674-
$scopeUsingAttribute = class_exists(Scope::class) && !empty($reflection->getAttributes(Scope::class));
672+
} elseif (!empty($reflection->getAttributes('\Illuminate\Database\Eloquent\Attributes\Scope')) || (Str::startsWith($method, 'scope') && $method !== 'scopeQuery' && $method !== 'scope' && $method !== 'scopes')) {
673+
$scopeUsingAttribute = !empty($reflection->getAttributes('\Illuminate\Database\Eloquent\Attributes\Scope'));
675674

676675
//Magic scope<name>Attribute
677676
$name = $scopeUsingAttribute ? $method : Str::camel(substr($method, 5));

0 commit comments

Comments
 (0)