Skip to content

Commit c32dcd4

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.6
# Conflicts: # system/Autoloader/Autoloader.php # system/BaseModel.php # system/CLI/CLI.php # system/Database/MigrationRunner.php # system/Exceptions/PageNotFoundException.php # system/Router/RouteCollection.php # system/Validation/FileRules.php # tests/system/Autoloader/AutoloaderTest.php # tests/system/Filters/FiltersTest.php # tests/system/Test/ControllerTestTraitTest.php # tests/system/Test/FeatureTestTraitTest.php # tests/system/Validation/CreditCardRulesTest.php # tests/system/Validation/FileRulesTest.php # tests/system/Validation/StrictRules/DatabaseRelatedRulesTest.php # tests/system/Validation/StrictRules/FileRulesTest.php # tests/system/View/ViewTest.php
2 parents 43a6241 + 27ae8bb commit c32dcd4

File tree

145 files changed

+660
-853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+660
-853
lines changed

admin/starter/tests/session/ExampleSessionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use CodeIgniter\Test\CIUnitTestCase;
4-
use Config\Services;
54

65
/**
76
* @internal
@@ -10,7 +9,7 @@ final class ExampleSessionTest extends CIUnitTestCase
109
{
1110
public function testSessionSimple(): void
1211
{
13-
$session = Services::session();
12+
$session = service('session');
1413

1514
$session->set('logged_in', 123);
1615
$this->assertSame(123, $session->get('logged_in'));

admin/starter/tests/unit/HealthTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use CodeIgniter\Test\CIUnitTestCase;
44
use Config\App;
5-
use Config\Services;
65
use Tests\Support\Libraries\ConfigReader;
76

87
/**
@@ -17,7 +16,7 @@ public function testIsDefinedAppPath(): void
1716

1817
public function testBaseUrlHasBeenSet(): void
1918
{
20-
$validation = Services::validation();
19+
$validation = service('validation');
2120

2221
$env = false;
2322

app/Config/Events.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
*/
4545
if (CI_DEBUG && ! is_cli()) {
4646
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
47-
Services::toolbar()->respond();
47+
service('toolbar')->respond();
4848
// Hot Reload route - for framework use on the hot reloader.
4949
if (ENVIRONMENT === 'development') {
50-
Services::routes()->get('__hot-reload', static function (): void {
50+
service('routes')->get('__hot-reload', static function (): void {
5151
(new HotReloader())->run();
5252
});
5353
}

app/Config/Format.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ class Format extends BaseConfig
7272
*/
7373
public function getFormatter(string $mime)
7474
{
75-
return Services::format()->getFormatter($mime);
75+
return service('format')->getFormatter($mime);
7676
}
7777
}

app/Controllers/BaseController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public function initController(RequestInterface $request, ResponseInterface $res
5353

5454
// Preload any models, libraries, etc, here.
5555

56-
// E.g.: $this->session = \Config\Services::session();
56+
// E.g.: $this->session = service('session');
5757
}
5858
}

app/Views/errors/html/error_exception.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
use CodeIgniter\HTTP\Header;
3-
use Config\Services;
43
use CodeIgniter\CodeIgniter;
54

65
$errorId = uniqid('error', true);
@@ -225,7 +224,7 @@
225224

226225
<!-- Request -->
227226
<div class="content" id="request">
228-
<?php $request = Services::request(); ?>
227+
<?php $request = service('request'); ?>
229228

230229
<table>
231230
<tbody>
@@ -343,7 +342,7 @@
343342

344343
<!-- Response -->
345344
<?php
346-
$response = Services::response();
345+
$response = service('response');
347346
$response->setStatusCode(http_response_code());
348347
?>
349348
<div class="content" id="response">

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"phpunit/phpcov": "^9.0.2 || ^10.0",
2929
"phpunit/phpunit": "^10.5.16 || ^11.2",
3030
"predis/predis": "^1.1 || ^2.0",
31-
"rector/rector": "1.2.8"
31+
"rector/rector": "1.2.10"
3232
},
3333
"replace": {
3434
"codeigniter4/framework": "self.version"

0 commit comments

Comments
 (0)