Skip to content

Commit 21bb145

Browse files
committed
Declare types for phpstan
1 parent 42e1094 commit 21bb145

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/bitExpert/PHPStan/Magento/Autoload/RegistrationUnitTest.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,25 @@ class RegistrationUnitTest extends TestCase
2121
* @test
2222
* @dataProvider provideAutoloaders()
2323
*/
24-
public function autoloadersCanRegisterAndUnregister(Autoloader $autoloader)
24+
public function autoloadersCanRegisterAndUnregister(Autoloader $autoloader): void
2525
{
26-
$autoloadFunctions = spl_autoload_functions();
26+
/** @var array<callable> $initialAutoloadFunctions */
27+
$initialAutoloadFunctions = spl_autoload_functions();
28+
2729
$autoloader->register();
28-
static::assertCount(count($autoloadFunctions) + 1, spl_autoload_functions());
30+
/** @var array<callable> $registerAutoloadFunctions */
31+
$registerAutoloadFunctions = spl_autoload_functions();
32+
static::assertCount(count($initialAutoloadFunctions) + 1, $registerAutoloadFunctions);
33+
2934
$autoloader->unregister();
30-
static::assertCount(count($autoloadFunctions), spl_autoload_functions());
35+
/** @var array<callable> $unregisterAutoloadFunctions */
36+
$unregisterAutoloadFunctions = spl_autoload_functions();
37+
static::assertCount(count($initialAutoloadFunctions), $unregisterAutoloadFunctions);
3138
}
3239

40+
/**
41+
* @return array<array<Autoloader>>
42+
*/
3343
public function provideAutoloaders(): array
3444
{
3545
$cache = new Cache($this->getMockBuilder(\PHPStan\Cache\CacheStorage::class)->getMock());

0 commit comments

Comments
 (0)