Skip to content

Commit ac723f4

Browse files
committed
use string classes for is_a() instead of initializing object
1 parent 8ed9515 commit ac723f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/Library/CrudPanel/Traits/Relationships.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ private function modelMethodIsRelationship($model, $method)
342342

343343
if ($returnType) {
344344
$returnType = $returnType->getName();
345-
if (is_a((new $returnType), 'Illuminate\Database\Eloquent\Casts\Attribute')) {
345+
if (is_a($returnType, 'Illuminate\Database\Eloquent\Casts\Attribute', true)) {
346346
return false;
347347
}
348348

349-
if (is_a((new $returnType), 'Illuminate\Database\Eloquent\Relations\Relation')) {
349+
if (is_a($returnType, 'Illuminate\Database\Eloquent\Relations\Relation', true)) {
350350
return $method;
351351
}
352352
}

0 commit comments

Comments
 (0)