diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index fca43a2..a1183a1 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,15 @@ parameters: ignoreErrors: + - + message: "#^Cannot call method getKeyName\\(\\) on Illuminate\\\\Database\\\\Eloquent\\\\Model\\|null\\.$#" + count: 2 + path: src/Mixins/CollectionMixin.php + + - + message: "#^Cannot call method newModelQuery\\(\\) on Illuminate\\\\Database\\\\Eloquent\\\\Model\\|null\\.$#" + count: 1 + path: src/Mixins/CollectionMixin.php + - message: "#^PHPDoc tag @mixin contains generic class Illuminate\\\\Database\\\\Eloquent\\\\Collection but does not specify its types\\: TKey, TModel$#" count: 1 diff --git a/src/Mixins/Result.php b/src/Mixins/Result.php index 265387c..49aac77 100644 --- a/src/Mixins/Result.php +++ b/src/Mixins/Result.php @@ -19,7 +19,7 @@ public function random(): Closure return null; } - return $this->offset(mt_rand(0, $total - 1))->first(); + return $this->offset(random_int(0, $total - 1))->first(); }; } }