Skip to content
Open
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 tests/system/Router/Controllers/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getIndex(): void
{
}

public function getSomeMethod($first = ''): void
public function getSomeMethod(string $first = ''): void
{
}
}
2 changes: 1 addition & 1 deletion tests/system/Router/Controllers/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class Index extends Controller
{
public function getIndex($p1 = ''): void
public function getIndex(string $p1 = ''): void
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/system/Router/Controllers/Mycontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getIndex(): void
{
}

public function getSomemethod($first = ''): void
public function getSomemethod(string $first = ''): void
{
}
}
2 changes: 1 addition & 1 deletion tests/system/Router/Controllers/Remap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class Remap extends Controller
{
public function _remap(string $method, ...$params): string
public function _remap(string $method, mixed ...$params): string
{
$method = 'process_' . $method;

Expand Down
2 changes: 1 addition & 1 deletion tests/system/Router/Controllers/SubDir/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getIndex(): void
{
}

public function getSomeMethod($first = ''): void
public function getSomeMethod(string $first = ''): void
{
}
}
2 changes: 1 addition & 1 deletion tests/system/Router/Controllers/Subfolder/Home.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class Home extends Controller
{
public function getIndex($p1 = null, $p2 = null): void
public function getIndex(?string $p1 = null, ?string $p2 = null): void
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getIndex(): void
{
}

public function getSomeMethod($first = ''): void
public function getSomeMethod(string $first = ''): void
{
}
}
4 changes: 2 additions & 2 deletions tests/system/Router/DefinedRouteCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#[Group('Others')]
final class DefinedRouteCollectorTest extends CIUnitTestCase
{
private function createRouteCollection(array $config = [], $moduleConfig = null): RouteCollection
private function createRouteCollection(array $config = [], ?Modules $moduleConfig = null): RouteCollection
{
$defaults = [
'Config' => APPPATH . 'Config',
Expand All @@ -37,7 +37,7 @@ private function createRouteCollection(array $config = [], $moduleConfig = null)

$loader = service('locator');

if ($moduleConfig === null) {
if (! $moduleConfig instanceof Modules) {
$moduleConfig = new Modules();
$moduleConfig->enabled = false;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Router/RouteCollectionReverseRouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function setUp(): void
$this->resetFactories();
}

protected function getCollector(array $config = [], array $files = [], $moduleConfig = null): RouteCollection
protected function getCollector(array $config = [], array $files = [], ?Modules $moduleConfig = null): RouteCollection
{
$defaults = [
'Config' => APPPATH . 'Config',
Expand All @@ -47,7 +47,7 @@ protected function getCollector(array $config = [], array $files = [], $moduleCo

$loader = service('locator');

if ($moduleConfig === null) {
if (! $moduleConfig instanceof Modules) {
$moduleConfig = new Modules();
$moduleConfig->enabled = false;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Router/RouteCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function setUp(): void
Services::injectMock('superglobals', new Superglobals());
}

protected function getCollector(array $config = [], array $files = [], $moduleConfig = null): RouteCollection
protected function getCollector(array $config = [], array $files = [], ?Modules $moduleConfig = null): RouteCollection
{
$defaults = [
'Config' => APPPATH . 'Config',
Expand All @@ -56,7 +56,7 @@ protected function getCollector(array $config = [], array $files = [], $moduleCo

$loader = service('locator');

if ($moduleConfig === null) {
if (! $moduleConfig instanceof Modules) {
$moduleConfig = new Modules();
$moduleConfig->enabled = false;
}
Expand Down
57 changes: 1 addition & 56 deletions utils/phpstan-baseline/missingType.parameter.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 30 errors
# total 20 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -87,61 +87,6 @@ parameters:
count: 1
path: ../../tests/system/Helpers/URLHelper/SiteUrlTest.php

-
message: '#^Method CodeIgniter\\Router\\Controllers\\BlogController\:\:getSomeMethod\(\) has parameter \$first with no type specified\.$#'
count: 1
path: ../../tests/system/Router/Controllers/BlogController.php

-
message: '#^Method CodeIgniter\\Router\\Controllers\\Index\:\:getIndex\(\) has parameter \$p1 with no type specified\.$#'
count: 1
path: ../../tests/system/Router/Controllers/Index.php

-
message: '#^Method CodeIgniter\\Router\\Controllers\\Mycontroller\:\:getSomemethod\(\) has parameter \$first with no type specified\.$#'
count: 1
path: ../../tests/system/Router/Controllers/Mycontroller.php

-
message: '#^Method CodeIgniter\\Router\\Controllers\\Remap\:\:_remap\(\) has parameter \$params with no type specified\.$#'
count: 1
path: ../../tests/system/Router/Controllers/Remap.php

-
message: '#^Method CodeIgniter\\Router\\Controllers\\SubDir\\BlogController\:\:getSomeMethod\(\) has parameter \$first with no type specified\.$#'
count: 1
path: ../../tests/system/Router/Controllers/SubDir/BlogController.php

-
message: '#^Method CodeIgniter\\Router\\Controllers\\Subfolder\\Home\:\:getIndex\(\) has parameter \$p1 with no type specified\.$#'
count: 1
path: ../../tests/system/Router/Controllers/Subfolder/Home.php

-
message: '#^Method CodeIgniter\\Router\\Controllers\\Subfolder\\Home\:\:getIndex\(\) has parameter \$p2 with no type specified\.$#'
count: 1
path: ../../tests/system/Router/Controllers/Subfolder/Home.php

-
message: '#^Method CodeIgniter\\Router\\Controllers\\Subfolder\\Sub\\BlogController\:\:getSomeMethod\(\) has parameter \$first with no type specified\.$#'
count: 1
path: ../../tests/system/Router/Controllers/Subfolder/Sub/BlogController.php

-
message: '#^Method CodeIgniter\\Router\\DefinedRouteCollectorTest\:\:createRouteCollection\(\) has parameter \$moduleConfig with no type specified\.$#'
count: 1
path: ../../tests/system/Router/DefinedRouteCollectorTest.php

-
message: '#^Method CodeIgniter\\Router\\RouteCollectionReverseRouteTest\:\:getCollector\(\) has parameter \$moduleConfig with no type specified\.$#'
count: 1
path: ../../tests/system/Router/RouteCollectionReverseRouteTest.php

-
message: '#^Method CodeIgniter\\Router\\RouteCollectionTest\:\:getCollector\(\) has parameter \$moduleConfig with no type specified\.$#'
count: 1
path: ../../tests/system/Router/RouteCollectionTest.php

-
message: '#^Method CodeIgniter\\Security\\SecurityCSRFSessionRandomizeTokenTest\:\:createSession\(\) has parameter \$options with no type specified\.$#'
count: 1
Expand Down
Loading