Skip to content

Commit 19e2a55

Browse files
FIX laravel 13 support
1 parent aa9a706 commit 19e2a55

4 files changed

Lines changed: 5 additions & 8 deletions

File tree

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ parameters:
66
- src
77

88
level: 5
9+
10+
ignoreErrors:
11+
- '#Call to an undefined static method .+::marks\(\)#'
12+
- '#Trait .+ is used zero times and is not analysed#'

src/Mark.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ protected static function validMarkable(Model $markable): bool
178178
throw InvalidMarkableInstanceException::create();
179179
}
180180

181-
/** @var Model&Markable $markable */
182181
if (! in_array(static::class, $markable::marks())) {
183182
throw InvalidMarkableInstanceException::create();
184183
}

src/Markable.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
use Maize\Markable\Scopes\MarkableScope;
99
use Maize\Markable\Support\Config;
1010

11-
/**
12-
* @phpstan-require-extends Model
13-
*/
1411
trait Markable
1512
{
1613
public static function bootMarkable(): void

src/Scopes/MarkableScope.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Illuminate\Database\Eloquent\Model;
77
use Illuminate\Database\Eloquent\Scope;
88
use Maize\Markable\Mark;
9-
use Maize\Markable\Markable;
109

1110
class MarkableScope implements Scope
1211
{
@@ -17,9 +16,7 @@ public function apply(Builder $builder, Model $model)
1716

1817
public function extend(Builder $builder)
1918
{
20-
/** @var Model&Markable $model */
21-
$model = $builder->getModel();
22-
$marks = $model::marks();
19+
$marks = $builder->getModel()::marks();
2320

2421
foreach ($marks as $mark) {
2522
$this->addWhereHasMark($builder, new $mark);

0 commit comments

Comments
 (0)