diff --git a/flight/commands/AiGenerateInstructionsCommand.php b/flight/commands/AiGenerateInstructionsCommand.php index cb78e9a..5190c3c 100644 --- a/flight/commands/AiGenerateInstructionsCommand.php +++ b/flight/commands/AiGenerateInstructionsCommand.php @@ -33,7 +33,7 @@ class AiGenerateInstructionsCommand extends AbstractBaseCommand * * @return int */ - public function execute() + public function execute(): int { $io = $this->app()->io(); diff --git a/flight/commands/AiInitCommand.php b/flight/commands/AiInitCommand.php index f24332d..92b468d 100644 --- a/flight/commands/AiInitCommand.php +++ b/flight/commands/AiInitCommand.php @@ -27,7 +27,7 @@ class AiInitCommand extends AbstractBaseCommand * * @return int */ - public function execute() + public function execute(): int { $io = $this->app()->io(); diff --git a/flight/commands/ControllerCommand.php b/flight/commands/ControllerCommand.php index a7c10bc..e61dada 100644 --- a/flight/commands/ControllerCommand.php +++ b/flight/commands/ControllerCommand.php @@ -26,7 +26,7 @@ class ControllerCommand extends AbstractBaseCommand * * @return void */ - public function execute(string $controller) + public function execute(string $controller): void { $io = $this->app()->io(); diff --git a/flight/commands/RouteCommand.php b/flight/commands/RouteCommand.php index d742708..1667934 100644 --- a/flight/commands/RouteCommand.php +++ b/flight/commands/RouteCommand.php @@ -37,7 +37,7 @@ class RouteCommand extends AbstractBaseCommand * * @return void */ - public function execute() + public function execute(): void { $io = $this->app()->io(); diff --git a/flight/net/Request.php b/flight/net/Request.php index 6e9aa93..31ff1b9 100644 --- a/flight/net/Request.php +++ b/flight/net/Request.php @@ -375,7 +375,7 @@ class Request * * @return string */ - public static function header(string $header, $default = '') + public static function header(string $header, $default = ''): string { return self::getHeader($header, $default); } diff --git a/tests/EngineTest.php b/tests/EngineTest.php index 91e9f3b..bdb5302 100644 --- a/tests/EngineTest.php +++ b/tests/EngineTest.php @@ -52,7 +52,7 @@ class EngineTest extends TestCase public function testInitBeforeStartV2OutputBuffering(): void { $engine = new class extends Engine { - public function getInitializedVar() + public function getInitializedVar(): bool { return $this->initialized; } @@ -122,7 +122,7 @@ class EngineTest extends TestCase $_SERVER['REQUEST_URI'] = '/someRoute'; $engine = new class extends Engine { - public function getInitializedVar() + public function getInitializedVar(): bool { return $this->initialized; } @@ -141,7 +141,7 @@ class EngineTest extends TestCase $_SERVER['REQUEST_URI'] = '/someRoute'; $engine = new class extends Engine { - public function getInitializedVar() + public function getInitializedVar(): bool { return $this->initialized; } @@ -160,7 +160,7 @@ class EngineTest extends TestCase $_SERVER['REQUEST_URI'] = '/someRoute'; $engine = new class extends Engine { - public function getInitializedVar() + public function getInitializedVar(): bool { return $this->initialized; } @@ -180,7 +180,7 @@ class EngineTest extends TestCase $_SERVER['REQUEST_URI'] = '/someRoute'; $engine = new class extends Engine { - public function getInitializedVar() + public function getInitializedVar(): bool { return $this->initialized; } @@ -207,7 +207,7 @@ class EngineTest extends TestCase $_SERVER['REQUEST_URI'] = '/someRoute'; $engine = new class extends Engine { - public function getInitializedVar() + public function getInitializedVar(): bool { return $this->initialized; } @@ -254,7 +254,7 @@ class EngineTest extends TestCase $_SERVER['REQUEST_URI'] = '/someRoute'; $engine = new class extends Engine { - public function getInitializedVar() + public function getInitializedVar(): bool { return $this->initialized; } @@ -276,7 +276,7 @@ class EngineTest extends TestCase $engine->start(); } - public function testDoubleStart() + public function testDoubleStart(): void { $engine = new Engine(); $engine->route('/someRoute', function () { @@ -512,7 +512,7 @@ class EngineTest extends TestCase $this->assertEquals('{"key1":"value1","key2":"value2","utf8_emoji":"😀"}', $engine->response()->getBody()); } - public function testJsonThrowOnErrorByDefault() + public function testJsonThrowOnErrorByDefault(): void { $engine = new Engine(); $this->expectException(Exception::class); @@ -1000,7 +1000,7 @@ class EngineTest extends TestCase $engine->start(); } - public function testContainerPsr11() { + public function testContainerPsr11(): void { $engine = new Engine(); $container = new \League\Container\Container(); $container->add(Container::class)->addArgument(Collection::class)->addArgument(PdoWrapper::class); @@ -1031,7 +1031,7 @@ class EngineTest extends TestCase $engine->start(); } - public function testContainerPsr11MethodNotFound() { + public function testContainerPsr11MethodNotFound(): void { $engine = new Engine(); $container = new \League\Container\Container(); $container->add(Container::class)->addArgument(Collection::class)->addArgument(PdoWrapper::class); @@ -1048,7 +1048,7 @@ class EngineTest extends TestCase $engine->start(); } - public function testRouteFoundButBadMethod() { + public function testRouteFoundButBadMethod(): void { $engine = new class extends Engine { public function getLoader() { diff --git a/tests/RouterTest.php b/tests/RouterTest.php index c0ed3c1..620ecc3 100644 --- a/tests/RouterTest.php +++ b/tests/RouterTest.php @@ -39,7 +39,7 @@ class RouterTest extends TestCase } // Checks if a route was matched with a given output - public function check($str = '') + public function check($str = ''): void { /*$route = $this->router->route($this->request); @@ -502,7 +502,7 @@ class RouterTest extends TestCase { $router = new class extends Router { - public function getIndex() + public function getIndex(): int { return $this->index; } diff --git a/tests/UploadedFileTest.php b/tests/UploadedFileTest.php index 9a531f5..f8817f3 100644 --- a/tests/UploadedFileTest.php +++ b/tests/UploadedFileTest.php @@ -55,7 +55,7 @@ class UploadedFileTest extends TestCase /** * @dataProvider getFileErrorMessageTests */ - public function testMoveToFailureMessages($error, $message) + public function testMoveToFailureMessages(int $error, string $message): void { file_put_contents('tmp_name', 'test'); $uploadedFile = new UploadedFile('file.txt', 'text/plain', 4, 'tmp_name', $error);