Skip to content

Commit 0abf1b9

Browse files
committed
fixed issues with php8-named-arguments
1 parent 62f31d7 commit 0abf1b9

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

flight/Engine.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ public function handleException(Throwable $e): void
266266
/**
267267
* Registers the container handler
268268
*
269-
* @template T of object
270-
*
271269
* @param ContainerInterface|callable(class-string<T> $id, array<int|string, mixed> $params): ?T $containerHandler Callback function or PSR-11 Container object that sets the container and how it will inject classes
270+
*
271+
* @template T of object
272272
*/
273273
public function registerContainerHandler($containerHandler): void
274274
{

flight/core/Dispatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ class Dispatcher
5252
/**
5353
* Sets the dependency injection container handler.
5454
*
55-
* @template T of object
56-
*
5755
* @param ContainerInterface|(callable(class-string<T> $classString, array<int, mixed> $params): ?T) $containerHandler
5856
* Dependency injection container.
5957
*
58+
* @template T of object
59+
*
6060
* @throws InvalidArgumentException If $containerHandler is not a `callable` or instance of `Psr\Container\ContainerInterface`.
6161
*/
6262
public function setContainerHandler($containerHandler): void

tests/FlightTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ public function testStaticRouteGroup()
134134
Flight::start();
135135
}
136136

137-
public function testStaticNestedGroups(): void {
137+
public function testStaticNestedGroups(): void
138+
{
138139
Flight::group('/', static function (): void {
139140
Flight::group('/', static function (): void {
140141
Flight::route('GET /', static function (): void {

tests/named-arguments/FlightTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ final class FlightTest extends TestCase
1919

2020
protected function setUp(): void
2121
{
22-
$this->engine = new Engine;
22+
$this->engine = new Engine();
2323
Flight::init();
2424
Flight::setEngine($this->engine);
2525
}
2626

2727
//////////////////
2828
// CORE METHODS //
2929
//////////////////
30-
public function test_path(): void
30+
public function testPath(): void
3131
{
32-
Flight::path(dir: __DIR__);
32+
Flight::path(dir: __DIR__); // phpcs:ignore
3333

3434
$exampleObject = new ExampleClass();
3535
self::assertInstanceOf(ExampleClass::class, $exampleObject);
3636
}
3737

38-
public function test_stop_with_code(): void
38+
public function testStopWithCode(): void
3939
{
4040
Flight::stop(code: 500);
4141

4242
self::expectOutputString('');
4343
self::assertSame(500, Flight::response()->status());
4444
}
4545

46-
public function test_halt(): void
46+
public function testHalt(): void
4747
{
4848
Flight::halt(actuallyExit: false, code: 500, message: 'Test');
4949

5050
self::expectOutputString('Test');
5151
self::assertSame(500, Flight::response()->status());
5252
}
5353

54-
public function test_register(): void
54+
public function testRegister(): void
5555
{
5656
Flight::register(
5757
class: stdClass::class,
@@ -71,11 +71,11 @@ class: stdClass::class,
7171
Flight::unregister(methodName: 'customClass');
7272
}
7373

74-
public function test_register_container(): void
74+
public function testRegisterContainer(): void
7575
{
7676
$dateTime = new DateTimeImmutable();
7777

78-
$controller = new class($dateTime) {
78+
$controller = new class ($dateTime) {
7979
public function __construct(private DateTimeImmutable $dateTime)
8080
{
8181
//
@@ -108,7 +108,7 @@ public function test(): void
108108
/////////////////////
109109
// ROUTING METHODS //
110110
/////////////////////
111-
public function test_static_route(): void
111+
public function testStaticRoute(): void
112112
{
113113
Flight::request()->url = '/test';
114114

0 commit comments

Comments
 (0)