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
9 changes: 0 additions & 9 deletions system/Config/BaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,6 @@ class BaseService
*/
protected static $discovered = false;

/**
* A cache of other service classes we've found.
*
* @var array
*
* @deprecated 4.5.0 No longer used.
*/
protected static $services = [];

/**
* A cache of the names of services classes found.
*
Expand Down
11 changes: 2 additions & 9 deletions system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,17 +517,10 @@ public static function renderer(?string $viewPath = null, ?ViewConfig $config =
* createRequest() injects IncomingRequest or CLIRequest.
*
* @return CLIRequest|IncomingRequest
*
* @deprecated The parameter $config and $getShared are deprecated.
*/
public static function request(?App $config = null, bool $getShared = true)
public static function request()
{
if ($getShared) {
return static::getSharedInstance('request', $config);
}

// @TODO remove the following code for backward compatibility
return AppServices::incomingrequest($config, $getShared);
return static::$instances['request'] ?? static::incomingrequest(getShared: false);
}

/**
Expand Down
8 changes: 7 additions & 1 deletion tests/system/CommonSingleServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ public function testSingleServiceWithAtLeastOneParamSupplied(string $service): v
$params = [];
$method = new ReflectionMethod(Services::class, $service);

$params[] = $method->getNumberOfParameters() === 1 ? true : $method->getParameters()[0]->getDefaultValue();
$count = $method->getNumberOfParameters();

if ($count === 0) {
$this->markTestSkipped("Service '{$service}' does not have any parameters.");
}

$params[] = $count === 1 ? true : $method->getParameters()[0]->getDefaultValue();

$service1 = single_service($service, ...$params); // @phpstan-ignore codeigniter.unknownServiceMethod
$service2 = single_service($service, ...$params); // @phpstan-ignore codeigniter.unknownServiceMethod
Expand Down
3 changes: 3 additions & 0 deletions user_guide_src/source/changelogs/v4.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Method Signature Changes
- The updated method signature is now ``handleRequest(?RouteCollectionInterface $routes, ?Cache $cacheConfig = null)``.
- ``CodeIgniter\CodeIgniter::gatherOutput()`` no longer accepts the deprecated ``$cacheConfig`` parameter.
As this is the first parameter, custom uses of this method will need to be updated to remove the parameter.
- **Config:** ``CodeIgniter\Config\Services::request()`` no longer accepts any parameter.

Removed Deprecated Items
========================
Expand Down Expand Up @@ -70,6 +71,8 @@ Removed Deprecated Items
- ``CodeIgniter\CodeIgniter::determinePath()``
- ``CodeIgniter\CodeIgniter::callExit()``
- ``CodeIgniter\Test\MockCodeIgniter::callExit()``
- **Config:** Removed the following property deprecated:
- ``CodeIgniter\Config\BaseService::$services`` (deprecated since v4.5.0)
- **Debug:** Removed the following properties and methods deprecated since v4.4.0:
- ``CodeIgniter\Debug\Exceptions::$ob_level``
- ``CodeIgniter\Debug\Exceptions::$viewPath``
Expand Down
2 changes: 1 addition & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 2116 errors
# total 2115 errors

includes:
- argument.type.neon
Expand Down
7 changes: 1 addition & 6 deletions utils/phpstan-baseline/missingType.iterableValue.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 1259 errors
# total 1258 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -237,11 +237,6 @@ parameters:
count: 1
path: ../../system/Config/BaseService.php

-
message: '#^Property CodeIgniter\\Config\\BaseService\:\:\$services type has no value type specified in iterable type array\.$#'
count: 1
path: ../../system/Config/BaseService.php

-
message: '#^Method CodeIgniter\\Config\\DotEnv\:\:normaliseVariable\(\) return type has no value type specified in iterable type array\.$#'
count: 1
Expand Down
Loading