Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into 4.6
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
michalsn committed Nov 17, 2024
2 parents 43a6241 + 27ae8bb commit c32dcd4
Show file tree
Hide file tree
Showing 145 changed files with 660 additions and 853 deletions.
3 changes: 1 addition & 2 deletions admin/starter/tests/session/ExampleSessionTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use CodeIgniter\Test\CIUnitTestCase;
use Config\Services;

/**
* @internal
Expand All @@ -10,7 +9,7 @@ final class ExampleSessionTest extends CIUnitTestCase
{
public function testSessionSimple(): void
{
$session = Services::session();
$session = service('session');

$session->set('logged_in', 123);
$this->assertSame(123, $session->get('logged_in'));
Expand Down
3 changes: 1 addition & 2 deletions admin/starter/tests/unit/HealthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use CodeIgniter\Test\CIUnitTestCase;
use Config\App;
use Config\Services;
use Tests\Support\Libraries\ConfigReader;

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

public function testBaseUrlHasBeenSet(): void
{
$validation = Services::validation();
$validation = service('validation');

$env = false;

Expand Down
4 changes: 2 additions & 2 deletions app/Config/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
*/
if (CI_DEBUG && ! is_cli()) {
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
Services::toolbar()->respond();
service('toolbar')->respond();
// Hot Reload route - for framework use on the hot reloader.
if (ENVIRONMENT === 'development') {
Services::routes()->get('__hot-reload', static function (): void {
service('routes')->get('__hot-reload', static function (): void {
(new HotReloader())->run();
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/Config/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ class Format extends BaseConfig
*/
public function getFormatter(string $mime)
{
return Services::format()->getFormatter($mime);
return service('format')->getFormatter($mime);
}
}
2 changes: 1 addition & 1 deletion app/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public function initController(RequestInterface $request, ResponseInterface $res

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

// E.g.: $this->session = \Config\Services::session();
// E.g.: $this->session = service('session');
}
}
5 changes: 2 additions & 3 deletions app/Views/errors/html/error_exception.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
use CodeIgniter\HTTP\Header;
use Config\Services;
use CodeIgniter\CodeIgniter;

$errorId = uniqid('error', true);
Expand Down Expand Up @@ -225,7 +224,7 @@

<!-- Request -->
<div class="content" id="request">
<?php $request = Services::request(); ?>
<?php $request = service('request'); ?>

<table>
<tbody>
Expand Down Expand Up @@ -343,7 +342,7 @@

<!-- Response -->
<?php
$response = Services::response();
$response = service('response');
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"phpunit/phpcov": "^9.0.2 || ^10.0",
"phpunit/phpunit": "^10.5.16 || ^11.2",
"predis/predis": "^1.1 || ^2.0",
"rector/rector": "1.2.8"
"rector/rector": "1.2.10"
},
"replace": {
"codeigniter4/framework": "self.version"
Expand Down
Loading

0 comments on commit c32dcd4

Please sign in to comment.