Skip to content

Commit dd71a0a

Browse files
committed
chore: integrate phpstan
1 parent 23598e9 commit dd71a0a

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"laravel/framework": "^11.35",
2424
"phpunit/phpunit": "^11.5",
2525
"orchestra/testbench-core": "^9.8",
26-
"friendsofphp/php-cs-fixer": "^3.65"
26+
"friendsofphp/php-cs-fixer": "^3.65",
27+
"phpstan/phpstan": "^2.0"
2728
},
2829
"scripts": {
2930
"test": "./vendor/bin/phpunit",

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 6
3+
paths:
4+
- src

src/FluentPendingBatch.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ class FluentPendingBatch extends PendingBatchFake
1313
/**
1414
* The jobs that have been checked.
1515
*
16-
* @var array
16+
* @var array<string>
1717
*/
1818
protected $expected = [];
1919

2020
/**
2121
* Assert that the batch contains a job of the given type.
2222
*
2323
* @param string|int $expectedJob
24-
* @param array $expectedParameters
24+
* @param array<mixed> $expectedParameters
2525
* @return $this
2626
*/
2727
public function has(string|int $expectedJob, array $expectedParameters = [])
@@ -70,7 +70,7 @@ public function missing(string $unexpectedJob)
7070
/**
7171
* Assert that the batch contains all of the given jobs.
7272
*
73-
* @param array $expectedJobs
73+
* @param array<string> $expectedJobs
7474
* @return $this
7575
*/
7676
public function hasAll(array $expectedJobs)
@@ -89,7 +89,7 @@ public function hasAll(array $expectedJobs)
8989
/**
9090
* Assert that the batch does not contain any of the given jobs.
9191
*
92-
* @param array $unexpectedJobs
92+
* @param array<string> $unexpectedJobs
9393
* @return $this
9494
*/
9595
public function missingAll(array $unexpectedJobs)
@@ -108,7 +108,7 @@ public function missingAll(array $unexpectedJobs)
108108
/**
109109
* Assert that the batch contains any of the given jobs.
110110
*
111-
* @param array $expectedJobs
111+
* @param array<string> $expectedJobs
112112
* @return $this
113113
*/
114114
public function hasAny(...$expectedJobs)
@@ -163,7 +163,7 @@ public function first(Closure $callback)
163163
*
164164
* @param int $index
165165
* @param Closure $callback
166-
* @param array $parameters
166+
* @param array<mixed> $parameters
167167
* @return $this
168168
*/
169169
public function nth(int $index, Closure|string $callback, array $parameters = [])
@@ -214,7 +214,7 @@ public function nth(int $index, Closure|string $callback, array $parameters = []
214214
/**
215215
* Assert that the batch contains exactly the given jobs with the specified parameters.
216216
*
217-
* @param array $expectedJobs
217+
* @param array<string, array<mixed>> $expectedJobs
218218
* @return $this
219219
*/
220220
public function equal(array $expectedJobs)
@@ -294,7 +294,7 @@ public function etc()
294294
*
295295
* @param mixed $actual
296296
* @param string $expectedClass
297-
* @param array $expectedParameters
297+
* @param array<mixed> $expectedParameters
298298
* @return bool
299299
*/
300300
protected function parametersMatch($actual, string $expectedClass, array $expectedParameters)

0 commit comments

Comments
 (0)