diff --git a/flight/Engine.php b/flight/Engine.php index 7f6ae0f..6c59ff5 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -266,9 +266,9 @@ class Engine /** * Registers the container handler * - * @template T of object - * * @param ContainerInterface|callable(class-string $id, array $params): ?T $containerHandler Callback function or PSR-11 Container object that sets the container and how it will inject classes + * + * @template T of object */ public function registerContainerHandler($containerHandler): void { diff --git a/flight/core/Dispatcher.php b/flight/core/Dispatcher.php index 12cf8ac..9d1873d 100644 --- a/flight/core/Dispatcher.php +++ b/flight/core/Dispatcher.php @@ -52,11 +52,11 @@ class Dispatcher /** * Sets the dependency injection container handler. * - * @template T of object - * * @param ContainerInterface|(callable(class-string $classString, array $params): ?T) $containerHandler * Dependency injection container. * + * @template T of object + * * @throws InvalidArgumentException If $containerHandler is not a `callable` or instance of `Psr\Container\ContainerInterface`. */ public function setContainerHandler($containerHandler): void diff --git a/tests/FlightTest.php b/tests/FlightTest.php index eea910f..9531ef7 100644 --- a/tests/FlightTest.php +++ b/tests/FlightTest.php @@ -134,7 +134,8 @@ class FlightTest extends TestCase Flight::start(); } - public function testStaticNestedGroups(): void { + public function testStaticNestedGroups(): void + { Flight::group('/', static function (): void { Flight::group('/', static function (): void { Flight::route('GET /', static function (): void { diff --git a/tests/named-arguments/FlightTest.php b/tests/named-arguments/FlightTest.php index fc27007..0d5abff 100644 --- a/tests/named-arguments/FlightTest.php +++ b/tests/named-arguments/FlightTest.php @@ -19,7 +19,7 @@ final class FlightTest extends TestCase protected function setUp(): void { - $this->engine = new Engine; + $this->engine = new Engine(); Flight::init(); Flight::setEngine($this->engine); } @@ -27,15 +27,15 @@ final class FlightTest extends TestCase ////////////////// // CORE METHODS // ////////////////// - public function test_path(): void + public function testPath(): void { - Flight::path(dir: __DIR__); + Flight::path(dir: __DIR__); // phpcs:ignore $exampleObject = new ExampleClass(); self::assertInstanceOf(ExampleClass::class, $exampleObject); } - public function test_stop_with_code(): void + public function testStopWithCode(): void { Flight::stop(code: 500); @@ -43,7 +43,7 @@ final class FlightTest extends TestCase self::assertSame(500, Flight::response()->status()); } - public function test_halt(): void + public function testHalt(): void { Flight::halt(actuallyExit: false, code: 500, message: 'Test'); @@ -51,7 +51,7 @@ final class FlightTest extends TestCase self::assertSame(500, Flight::response()->status()); } - public function test_register(): void + public function testRegister(): void { Flight::register( class: stdClass::class, @@ -71,11 +71,11 @@ final class FlightTest extends TestCase Flight::unregister(methodName: 'customClass'); } - public function test_register_container(): void + public function testRegisterContainer(): void { $dateTime = new DateTimeImmutable(); - $controller = new class($dateTime) { + $controller = new class ($dateTime) { public function __construct(private DateTimeImmutable $dateTime) { // @@ -108,7 +108,7 @@ final class FlightTest extends TestCase ///////////////////// // ROUTING METHODS // ///////////////////// - public function test_static_route(): void + public function testStaticRoute(): void { Flight::request()->url = '/test';