Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flight/commands/AiGenerateInstructionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(array $config)
*
* @return int
*/
public function execute()
public function execute(): int
{
$io = $this->app()->io();

Expand Down
2 changes: 1 addition & 1 deletion flight/commands/AiInitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(array $config)
*
* @return int
*/
public function execute()
public function execute(): int
{
$io = $this->app()->io();

Expand Down
2 changes: 1 addition & 1 deletion flight/commands/ControllerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(array $config)
*
* @return void
*/
public function execute(string $controller)
public function execute(string $controller): void
{
$io = $this->app()->io();

Expand Down
2 changes: 1 addition & 1 deletion flight/commands/RouteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(array $config)
*
* @return void
*/
public function execute()
public function execute(): void
{
$io = $this->app()->io();

Expand Down
2 changes: 1 addition & 1 deletion flight/net/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public static function getHeaders(): array
*
* @return string
*/
public static function header(string $header, $default = '')
public static function header(string $header, $default = ''): string
{
return self::getHeader($header, $default);
}
Expand Down
24 changes: 12 additions & 12 deletions tests/EngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function getInitializedVar()
public function testInitBeforeStartV2OutputBuffering(): void
{
$engine = new class extends Engine {
public function getInitializedVar()
public function getInitializedVar(): bool
{
return $this->initialized;
}
Expand Down Expand Up @@ -122,7 +122,7 @@ public function testStartWithRoute(): void
$_SERVER['REQUEST_URI'] = '/someRoute';

$engine = new class extends Engine {
public function getInitializedVar()
public function getInitializedVar(): bool
{
return $this->initialized;
}
Expand All @@ -141,7 +141,7 @@ public function testStartWithRouteButReturnedValueThrows404(): void
$_SERVER['REQUEST_URI'] = '/someRoute';

$engine = new class extends Engine {
public function getInitializedVar()
public function getInitializedVar(): bool
{
return $this->initialized;
}
Expand All @@ -160,7 +160,7 @@ public function testStartWithRouteButReturnedValueThrows404V2OutputBuffering():
$_SERVER['REQUEST_URI'] = '/someRoute';

$engine = new class extends Engine {
public function getInitializedVar()
public function getInitializedVar(): bool
{
return $this->initialized;
}
Expand All @@ -180,7 +180,7 @@ public function testDoubleReturnTrueRoutesContinueIteration(): void
$_SERVER['REQUEST_URI'] = '/someRoute';

$engine = new class extends Engine {
public function getInitializedVar()
public function getInitializedVar(): bool
{
return $this->initialized;
}
Expand All @@ -207,7 +207,7 @@ public function testDoubleReturnTrueWithMethodMismatchDuringIteration(): void
$_SERVER['REQUEST_URI'] = '/someRoute';

$engine = new class extends Engine {
public function getInitializedVar()
public function getInitializedVar(): bool
{
return $this->initialized;
}
Expand Down Expand Up @@ -254,7 +254,7 @@ public function testIteratorReachesEndWithoutMatch(): void
$_SERVER['REQUEST_URI'] = '/someRoute';

$engine = new class extends Engine {
public function getInitializedVar()
public function getInitializedVar(): bool
{
return $this->initialized;
}
Expand All @@ -276,7 +276,7 @@ public function getInitializedVar()
$engine->start();
}

public function testDoubleStart()
public function testDoubleStart(): void
{
$engine = new Engine();
$engine->route('/someRoute', function () {
Expand Down Expand Up @@ -512,7 +512,7 @@ public function testJsonWithDuplicateDefaultFlags()
$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);
Expand Down Expand Up @@ -1000,7 +1000,7 @@ public function testContainerDiceBadMethod() {
$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);
Expand Down Expand Up @@ -1031,7 +1031,7 @@ public function testContainerPsr11ClassNotFound() {
$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);
Expand All @@ -1048,7 +1048,7 @@ public function testContainerPsr11MethodNotFound() {
$engine->start();
}

public function testRouteFoundButBadMethod() {
public function testRouteFoundButBadMethod(): void {
$engine = new class extends Engine {
public function getLoader()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function ok(): void
}

// 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);
Expand Down Expand Up @@ -502,7 +502,7 @@ public function testResetRoutes(): void
{
$router = new class extends Router
{
public function getIndex()
public function getIndex(): int
{
return $this->index;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/UploadedFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getFileErrorMessageTests(): array
/**
* @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);
Expand Down