Skip to content

Commit

Permalink
refactor: Add ArrowFunction return type #1183
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Jan 1, 2025
1 parent 725296f commit 9a5e106
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/BootloadManager/BootloadConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testDisabledConfig(): void
public function testCallableConfig(): void
{
$result = \iterator_to_array($this->initializer->init([
BootloaderA::class => static fn () => new BootloadConfig(args: ['a' => 'b']),
BootloaderA::class => static fn (): BootloadConfig => new BootloadConfig(args: ['a' => 'b']),
]));

$this->assertEquals([
Expand All @@ -79,12 +79,12 @@ public function testCallableConfigWithArguments(): void
$this->container->bind(AppEnvironment::class, AppEnvironment::Production);

$result = \iterator_to_array($this->initializer->init([
BootloaderA::class => static fn (AppEnvironment $env) => new BootloadConfig(enabled: $env->isLocal()),
BootloaderA::class => static fn (AppEnvironment $env): BootloadConfig => new BootloadConfig(enabled: $env->isLocal()),
]));
$this->assertEquals([], $result);

$result = \iterator_to_array($this->initializer->init([
BootloaderA::class => static fn (AppEnvironment $env) => new BootloadConfig(enabled: $env->isProduction()),
BootloaderA::class => static fn (AppEnvironment $env): BootloadConfig => new BootloadConfig(enabled: $env->isProduction()),
]));
$this->assertEquals([BootloaderA::class => ['bootloader' => new BootloaderA(), 'options' => []]], $result);
}
Expand Down

0 comments on commit 9a5e106

Please sign in to comment.