Skip to content

Commit

Permalink
Release v4.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 28, 2024
1 parent da97032 commit 2f7ef20
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
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');
}
}
2 changes: 1 addition & 1 deletion app/Views/errors/cli/error_exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

$args = implode(', ', array_map(static fn ($value) => match (true) {
is_object($value) => 'Object(' . $value::class . ')',
is_array($value) => count($value) ? '[...]' : '[]',
is_array($value) => $value !== [] ? '[...]' : '[]',
$value === null => 'null', // return the lowercased version
default => var_export($value, true),
}, array_values($error['args'] ?? [])));
Expand Down
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
3 changes: 1 addition & 2 deletions 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 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

0 comments on commit 2f7ef20

Please sign in to comment.