Skip to content

Commit 8b6fb8c

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.8
2 parents 102bc17 + 731a5e7 commit 8b6fb8c

63 files changed

Lines changed: 2702 additions & 172 deletions

Some content is hidden

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

‎.github/carson.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ subscribers:
1313
settings:
1414
auto-labeler:
1515
sync_labels: true
16+
sync_exempt:
17+
- enhancement
1618
rules:
1719
- label: '4.8' # @todo change value whenever the next minor version is changed
1820
base_branch: ['^4\.8$']
@@ -66,7 +68,7 @@ settings:
6668
pr-title-linter:
6769
name: 'Carson / pr-title-linter'
6870
rules:
69-
- pattern: '^(\[\d+\.\d+\]\s{1})?(feat|fix|chore|docs|perf|refactor|style|test|config|revert)(\([\-.@:`a-zA-Z0-9]+\))?!?:\s{1}\S.+\S|Prep for \d\.\d\.\d release|\d\.\d\.\d (Ready|Merge) code$'
71+
- pattern: '^(?:(?:\[\d+\.\d+\] )?(?:feat|fix|chore|docs|perf|refactor|style|test|config|revert)(?:\([\-.@:`a-zA-Z0-9]+\))?!?: \S.+\S|Prep for \d+\.\d+\.\d+ release|\d+\.\d+\.\d+ (?:Ready|Merge) code)$'
7072
description: 'PR title must include the type (feat, fix, chore, docs, perf, refactor, style, test, config, revert) of the commit per Conventional Commits specification. See https://www.conventionalcommits.org/en/v1.0.0/ for the discussion.'
7173
level: error
7274
signed-commits:

‎.github/workflows/run-carson.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ permissions: {}
2828

2929
jobs:
3030
carson:
31+
if: github.repository == 'codeigniter4/CodeIgniter4'
3132
runs-on: ubuntu-24.04
3233
steps:
3334
- name: Run Carson

‎.github/workflows/verify-release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
php-version: '8.2'
7777
tools: composer
7878
extensions: intl, gd
79-
coverage: none
79+
coverage: xdebug
8080

8181
- name: Wait for Packagist to serve the new framework version
8282
run: |

‎CHANGELOG.md‎

Lines changed: 154 additions & 0 deletions
Large diffs are not rendered by default.

‎app/Config/View.php‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class View extends BaseView
3030
* { title|esc(js) }
3131
* { created_on|date(Y-m-d)|esc(attr) }
3232
*
33-
* @var array<string, (callable(mixed): mixed)&string>
33+
* @var array<string, callable(mixed): mixed>
3434
*/
3535
public $filters = [];
3636

@@ -43,6 +43,14 @@ class View extends BaseView
4343
*/
4444
public $plugins = [];
4545

46+
/**
47+
* When true, Parser conditionals may only contain variables, literals,
48+
* arithmetic, comparison and logical operators, and parentheses. Enable
49+
* this when less-trusted users can edit Parser templates. Can be overridden per
50+
* call with the `restrictConditionals` render option.
51+
*/
52+
public bool $restrictParserConditionals = false;
53+
4654
/**
4755
* View Decorators are class methods that will be run in sequence to
4856
* have a chance to alter the generated output just prior to caching

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"phpunit/phpcov": "^9.0.2 || ^10.0",
3030
"phpunit/phpunit": "^10.5.16 || ^11.2",
3131
"predis/predis": "^3.0",
32-
"rector/rector": "2.6.7",
32+
"rector/rector": "2.7.0",
3333
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
3434
},
3535
"replace": {

‎phpdoc.dist.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<output>api/build/</output>
1111
<cache>api/cache/</cache>
1212
</paths>
13-
<version number="4.7.4">
13+
<version number="4.7.5">
1414
<api format="php">
1515
<source dsn=".">
1616
<path>system</path>

‎rector.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Rector\CodeQuality\Rector\BooleanNot\NegatedAndsToPositiveOrsRector;
1616
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
1717
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
18-
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
1918
use Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector;
2019
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
2120
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
@@ -101,6 +100,7 @@
101100

102101
// Exclude test file because `is_cli()` is mocked and Rector might remove needed parameters.
103102
RemoveExtraParametersRector::class => [
103+
__DIR__ . '/tests/system/CLI/CLITest.php',
104104
__DIR__ . '/tests/system/Debug/ToolbarTest.php',
105105
],
106106

@@ -177,7 +177,6 @@
177177
->withRules([
178178
DeclareStrictTypesRector::class,
179179
UnderscoreToCamelCaseVariableNameRector::class,
180-
SimplifyUselessVariableRector::class,
181180
PassStrictParameterToFunctionParameterRector::class,
182181
RemoveErrorSuppressInTryCatchStmtsRector::class,
183182
FuncGetArgsToVariadicParamRector::class,

‎system/CLI/CLI.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public static function error(string $text, string $foreground = 'light_red', ?st
463463
// Check color support for STDERR
464464
$stdout = static::$isColored;
465465

466-
static::$isColored = static::hasColorSupport(STDERR);
466+
static::$isColored = is_cli() && static::hasColorSupport(STDERR);
467467

468468
if ($foreground !== '' || (string) $background !== '') {
469469
$text = static::color($text, $foreground, $background);
@@ -475,7 +475,7 @@ public static function error(string $text, string $foreground = 'light_red', ?st
475475
static::$lastWrite = 'write';
476476
}
477477

478-
static::fwrite(STDERR, $text . PHP_EOL);
478+
static::fwrite(is_cli() ? STDERR : STDOUT, $text . PHP_EOL);
479479

480480
// return STDOUT color support
481481
static::$isColored = $stdout;
@@ -544,7 +544,7 @@ public static function clearScreen()
544544
{
545545
// Unix systems, and Windows with VT100 Terminal support (i.e. Win10)
546546
// can handle CSI sequences. For lower than Win10 we just shove in 40 new lines.
547-
is_windows() && ! static::streamSupports('sapi_windows_vt100_support', STDOUT)
547+
is_windows() && is_cli() && ! static::streamSupports('sapi_windows_vt100_support', STDOUT)
548548
? static::newLine(40)
549549
: static::fwrite(STDOUT, "\033[H\033[2J");
550550
}

‎system/CLI/SignalTrait.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ protected function getProcessState(): array
394394
if ($this->isPosixAvailable()) {
395395
$state['session_id'] = posix_getsid($pid);
396396
$state['process_group'] = posix_getpgid($pid);
397-
$state['has_controlling_terminal'] = posix_isatty(STDIN);
397+
$state['has_controlling_terminal'] = is_cli() && posix_isatty(STDIN);
398398
}
399399

400400
return $state;

0 commit comments

Comments
 (0)