Skip to content

Commit ff3bbf0

Browse files
committed
Fix phpstan
1 parent c856bd1 commit ff3bbf0

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@phpcs"
7575
],
7676
"style:phpstan": [
77-
"@phpstan -l 8"
77+
"@phpstan -l 9"
7878
],
7979
"style:check": [
8080
"@style:phpcs",

src/Convertor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public static function toArray(mixed $data, ?int $limit = null): array
3737
return self::toArrayWithDepth($data, $limit ?? PHP_INT_MAX, 1);
3838
}
3939

40+
/**
41+
* @return ($depth is 1 ? array<mixed> : mixed)
42+
*/
4043
private static function toArrayWithDepth(mixed $data, int $limit, int $depth): mixed
4144
{
4245
if ($limit <= 0) {

tests/BaseModelTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
final class BaseModelTest extends TestCase
1313
{
1414
/**
15+
* @param array<mixed> $data
16+
*
1517
* @dataProvider providesToArray
1618
*/
17-
public function testJsonSerialize(mixed $data, string|Throwable $result): void
19+
public function testJsonSerialize(array $data, string|Throwable $result): void
1820
{
1921
if ($result instanceof Throwable) {
2022
self::expectException($result::class);

0 commit comments

Comments
 (0)