Skip to content

Commit d146e43

Browse files
committed
refactor: add precise parameter types to Router test fixtures
1 parent 69796fc commit d146e43

11 files changed

Lines changed: 11 additions & 66 deletions

File tree

tests/system/Router/Controllers/BlogController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function getIndex(): void
2121
{
2222
}
2323

24-
public function getSomeMethod($first = ''): void
24+
public function getSomeMethod(string $first = ''): void
2525
{
2626
}
2727
}

tests/system/Router/Controllers/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class Index extends Controller
1919
{
20-
public function getIndex($p1 = ''): void
20+
public function getIndex(string $p1 = ''): void
2121
{
2222
}
2323

tests/system/Router/Controllers/Mycontroller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function getIndex(): void
2121
{
2222
}
2323

24-
public function getSomemethod($first = ''): void
24+
public function getSomemethod(string $first = ''): void
2525
{
2626
}
2727
}

tests/system/Router/Controllers/Remap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class Remap extends Controller
2020
{
21-
public function _remap(string $method, ...$params): string
21+
public function _remap(string $method, mixed ...$params): string
2222
{
2323
$method = 'process_' . $method;
2424

tests/system/Router/Controllers/SubDir/BlogController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function getIndex(): void
2121
{
2222
}
2323

24-
public function getSomeMethod($first = ''): void
24+
public function getSomeMethod(string $first = ''): void
2525
{
2626
}
2727
}

tests/system/Router/Controllers/Subfolder/Home.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class Home extends Controller
1919
{
20-
public function getIndex($p1 = null, $p2 = null): void
20+
public function getIndex(?string $p1 = null, ?string $p2 = null): void
2121
{
2222
}
2323
}

tests/system/Router/Controllers/Subfolder/Sub/BlogController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function getIndex(): void
2121
{
2222
}
2323

24-
public function getSomeMethod($first = ''): void
24+
public function getSomeMethod(string $first = ''): void
2525
{
2626
}
2727
}

tests/system/Router/DefinedRouteCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#[Group('Others')]
2626
final class DefinedRouteCollectorTest extends CIUnitTestCase
2727
{
28-
private function createRouteCollection(array $config = [], $moduleConfig = null): RouteCollection
28+
private function createRouteCollection(array $config = [], ?Modules $moduleConfig = null): RouteCollection
2929
{
3030
$defaults = [
3131
'Config' => APPPATH . 'Config',

tests/system/Router/RouteCollectionReverseRouteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function setUp(): void
3535
$this->resetFactories();
3636
}
3737

38-
protected function getCollector(array $config = [], array $files = [], $moduleConfig = null): RouteCollection
38+
protected function getCollector(array $config = [], array $files = [], ?Modules $moduleConfig = null): RouteCollection
3939
{
4040
$defaults = [
4141
'Config' => APPPATH . 'Config',

tests/system/Router/RouteCollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function setUp(): void
4444
Services::injectMock('superglobals', new Superglobals());
4545
}
4646

47-
protected function getCollector(array $config = [], array $files = [], $moduleConfig = null): RouteCollection
47+
protected function getCollector(array $config = [], array $files = [], ?Modules $moduleConfig = null): RouteCollection
4848
{
4949
$defaults = [
5050
'Config' => APPPATH . 'Config',

0 commit comments

Comments
 (0)