Skip to content

Commit 196e26d

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.8
# Conflicts: # system/Autoloader/Autoloader.php # system/Filters/Filters.php # utils/phpstan-baseline/loader.neon
2 parents f474a88 + b281d3f commit 196e26d

File tree

42 files changed

+123
-147
lines changed

Some content is hidden

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

42 files changed

+123
-147
lines changed

.github/scripts/random-tests-config.txt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@
99
# Reference: https://github.com/codeigniter4/CodeIgniter4/issues/9968
1010

1111
API
12-
# AutoReview
13-
# Autoloader
12+
AutoReview
13+
Autoloader
1414
# Cache
1515
CLI
1616
# Commands
1717
# Config
18-
# Cookie
19-
# DataCaster
18+
Cookie
19+
DataCaster
2020
# DataConverter
2121
# Database
22-
# Debug
23-
# Email
24-
# Encryption
25-
# Entity
26-
# Events
27-
# Files
22+
Debug
23+
Email
24+
Encryption
25+
Entity
26+
Events
27+
Files
2828
# Filters
29-
# Format
29+
Format
3030
# HTTP
3131
# Helpers
3232
# Honeypot
33-
# HotReloader
34-
# I18n
33+
HotReloader
34+
I18n
3535
# Images
36-
# Language
37-
# Log
36+
Language
37+
Log
3838
# Models
39-
# Pager
40-
# Publisher
41-
# RESTful
39+
Pager
40+
Publisher
41+
RESTful
4242
# Router
43-
# Security
43+
Security
4444
# Session
4545
# Test
46-
# Throttle
47-
# Typography
46+
Throttle
47+
Typography
4848
# Validation
49-
# View
49+
View

.github/scripts/run-random-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
################################################################################
2424

2525
set -u
26+
export LC_NUMERIC=C
2627
trap 'kill "${bg_pids[@]:-}" 2>/dev/null; wait 2>/dev/null' EXIT INT TERM
2728

2829
################################################################################

.github/workflows/reusable-phpunit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
--health-retries=3
115115
116116
oracle:
117-
image: gvenzl/oracle-xe:21
117+
image: gvenzl/oracle-free:latest
118118
env:
119119
ORACLE_RANDOM_PASSWORD: true
120120
APP_USER: ORACLE

.github/workflows/test-random-execution.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
- 'system/**.php'
2626
- 'tests/**.php'
2727

28-
workflow_call:
28+
workflow_dispatch:
2929
inputs:
3030
quiet:
3131
description: Suppress debug output
@@ -120,7 +120,7 @@ jobs:
120120
--health-retries=3
121121
122122
oracle:
123-
image: gvenzl/oracle-xe:21
123+
image: gvenzl/oracle-free:latest
124124
env:
125125
ORACLE_RANDOM_PASSWORD: true
126126
APP_USER: ORACLE
@@ -223,3 +223,12 @@ jobs:
223223
env:
224224
DB: ${{ matrix.db-platform }}
225225
TERM: xterm-256color
226+
227+
- name: Upload random-test artifacts on failure
228+
if: ${{ always() && failure() }}
229+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
230+
with:
231+
name: random-tests-${{ matrix.db-platform }}-php${{ matrix.php-version }}
232+
path: build/random-tests/
233+
retention-days: 1
234+
overwrite: true

app/Config/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Database extends Config
143143
// * @var array<string, mixed>
144144
// */
145145
// public array $default = [
146-
// 'DSN' => 'localhost:1521/XEPDB1',
146+
// 'DSN' => 'localhost:1521/FREEPDB1',
147147
// 'username' => 'root',
148148
// 'password' => 'root',
149149
// 'DBDriver' => 'OCI8',

system/Autoloader/Autoloader.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ class Autoloader
9393
*/
9494
protected $helpers = ['url'];
9595

96+
public function __construct(private readonly string $composerPath = COMPOSER_PATH)
97+
{
98+
}
99+
96100
/**
97101
* Reads in the configuration array (described above) and stores
98102
* the valid parts that we'll need.
@@ -127,7 +131,7 @@ public function initialize(Autoload $config, Modules $modules)
127131
$this->helpers = [...$this->helpers, ...$config->helpers];
128132
}
129133

130-
if (is_file(COMPOSER_PATH)) {
134+
if (is_file($this->composerPath)) {
131135
$this->loadComposerAutoloader($modules);
132136
}
133137

@@ -139,11 +143,11 @@ private function loadComposerAutoloader(Modules $modules): void
139143
// The path to the vendor directory.
140144
// We do not want to enforce this, so set the constant if Composer was used.
141145
if (! defined('VENDORPATH')) {
142-
define('VENDORPATH', dirname(COMPOSER_PATH) . DIRECTORY_SEPARATOR);
146+
define('VENDORPATH', dirname($this->composerPath) . DIRECTORY_SEPARATOR);
143147
}
144148

145149
/** @var ClassLoader $composer */
146-
$composer = include COMPOSER_PATH;
150+
$composer = include $this->composerPath;
147151

148152
// Should we load through Composer's namespaces, also?
149153
if ($modules->discoverInComposer) {

system/BaseModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ public function findColumn(string $columnName)
670670
*/
671671
public function findAll(?int $limit = null, int $offset = 0)
672672
{
673-
$limitZeroAsAll = config(Feature::class)->limitZeroAsAll ?? true;
673+
$limitZeroAsAll = config(Feature::class)->limitZeroAsAll ?? true; // @phpstan-ignore nullCoalesce.property
674674
if ($limitZeroAsAll) {
675675
$limit ??= 0;
676676
}

system/Boot.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public static function preload(Paths $paths): void
205205
protected static function loadDotEnv(Paths $paths): void
206206
{
207207
require_once $paths->systemDirectory . '/Config/DotEnv.php';
208-
$envDirectory = $paths->envDirectory ?? $paths->appDirectory . '/../';
208+
$envDirectory = $paths->envDirectory ?? $paths->appDirectory . '/../'; // @phpstan-ignore nullCoalesce.property
209209
(new DotEnv($envDirectory))->load();
210210
}
211211

system/Cache/CacheFactory.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,10 @@ class CacheFactory
4949
*/
5050
public static function getHandler(Cache $config, ?string $handler = null, ?string $backup = null)
5151
{
52-
if (! isset($config->validHandlers) || $config->validHandlers === []) {
52+
if ($config->validHandlers === []) {
5353
throw CacheException::forInvalidHandlers();
5454
}
5555

56-
if (! isset($config->handler) || ! isset($config->backupHandler)) {
57-
throw CacheException::forNoBackup();
58-
}
59-
6056
$handler ??= $config->handler;
6157
$backup ??= $config->backupHandler;
6258

system/Cache/Handlers/PredisHandler.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ public function __construct(Cache $config)
6565
{
6666
$this->prefix = $config->prefix;
6767

68-
if (isset($config->redis)) {
69-
$this->config = array_merge($this->config, $config->redis);
70-
}
68+
$this->config = array_merge($this->config, $config->redis);
7169
}
7270

7371
public function initialize(): void

0 commit comments

Comments
 (0)