Skip to content

Commit 713d354

Browse files
committed
Fix PHPStan nullCoalesce.property and staticMethod errors
- Factory: Fix PHPDoc to allow null for $modelNameResolver, $factoryNameResolver - Sleep/EventFake: Add ignores for intentional assertTrue(true) assertion counting
1 parent e5d53f5 commit 713d354

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/core/src/Database/Eloquent/Factories/Factory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ abstract class Factory
9696
/**
9797
* The default model name resolver.
9898
*
99-
* @var callable(self): class-string<TModel>
99+
* @var null|(callable(self): class-string<TModel>)
100100
*/
101101
protected static $modelNameResolver;
102102

103103
/**
104104
* The factory name resolver.
105105
*
106-
* @var callable(class-string<Model>): class-string<Factory>
106+
* @var null|(callable(class-string<Model>): class-string<Factory>)
107107
*/
108108
protected static $factoryNameResolver;
109109

src/support/src/Sleep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public static function assertNeverSlept(): void
397397
public static function assertInsomniac(): void
398398
{
399399
if (static::$sequence === []) {
400-
PHPUnit::assertTrue(true);
400+
PHPUnit::assertTrue(true); // @phpstan-ignore staticMethod.alreadyNarrowedType (intentional for assertion count)
401401
}
402402

403403
foreach (static::$sequence as $duration) {

src/support/src/Testing/Fakes/EventFake.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function assertListening(string $expectedEvent, string $expectedListener)
7878
if ($actualListener === $expectedListener
7979
|| ($actualListener instanceof Closure
8080
&& $expectedListener === Closure::class)) {
81-
PHPUnit::assertTrue(true);
81+
PHPUnit::assertTrue(true); // @phpstan-ignore staticMethod.alreadyNarrowedType (intentional for assertion count)
8282

8383
return;
8484
}

0 commit comments

Comments
 (0)