Skip to content

Commit a84634d

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.7
# Conflicts: # rector.php # utils/phpstan-baseline/empty.notAllowed.neon # utils/phpstan-baseline/loader.neon # utils/phpstan-baseline/missingType.iterableValue.neon
2 parents 858d040 + 0e15d04 commit a84634d

Some content is hidden

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

52 files changed

+355
-145
lines changed

.github/workflows/deploy-userguide-latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
5858
# Create an artifact of the html output
5959
- name: Upload artifact
60-
uses: actions/upload-artifact@v4
60+
uses: actions/upload-artifact@v5
6161
with:
6262
name: HTML Documentation
6363
path: user_guide_src/build/html/

.github/workflows/reusable-coveralls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
coverage: xdebug
3131

3232
- name: Download coverage files
33-
uses: actions/download-artifact@v5
33+
uses: actions/download-artifact@v6
3434
with:
3535
path: build/cov
3636

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ jobs:
213213

214214
- name: Upload coverage results as artifact
215215
if: ${{ inputs.enable-artifact-upload }}
216-
uses: actions/upload-artifact@v4
216+
uses: actions/upload-artifact@v5
217217
with:
218218
name: ${{ env.ARTIFACT_NAME }}
219219
path: build/cov/coverage-${{ env.ARTIFACT_NAME }}.cov

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122

123123
- name: Upload coverage results as artifact
124124
if: ${{ inputs.enable-artifact-upload }}
125-
uses: actions/upload-artifact@v4
125+
uses: actions/upload-artifact@v5
126126
with:
127127
name: ${{ env.ARTIFACT_NAME }}
128128
path: build/cov/coverage-${{ env.ARTIFACT_NAME }}.cov

.github/workflows/test-scss.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uses: actions/checkout@v5
3737

3838
- name: Setup Node
39-
uses: actions/setup-node@v5.0.0
39+
uses: actions/setup-node@v6.0.0
4040
with:
4141
# node version based on dart-sass test workflow
4242
node-version: 16

admin/starter/app/Config/Paths.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
* share a system folder between multiple applications, and more.
1313
*
1414
* All paths are relative to the project's root folder.
15+
*
16+
* NOTE: This class is required prior to Autoloader instantiation,
17+
* and does not extend BaseConfig.
1518
*/
1619
class Paths
1720
{

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": "^3.0",
31-
"rector/rector": "2.2.1",
31+
"rector/rector": "2.2.8",
3232
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
3333
},
3434
"replace": {

rector.php

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector;
2626
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
2727
use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector;
28+
use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector;
2829
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
2930
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
3031
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
@@ -35,10 +36,12 @@
3536
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
3637
use Rector\PHPUnit\CodeQuality\Rector\Class_\RemoveDataProviderParamKeysRector;
3738
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
39+
use Rector\PHPUnit\CodeQuality\Rector\FuncCall\AssertFuncCallToPHPUnitAssertRector;
40+
use Rector\PHPUnit\CodeQuality\Rector\StmtsAwareInterface\DeclareStrictTypesTestsRector;
41+
use Rector\Privatization\Rector\Class_\FinalizeTestCaseClassRector;
3842
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
3943
use Rector\Renaming\Rector\ConstFetch\RenameConstantRector;
4044
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
41-
use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector;
4245
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
4346
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
4447
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
@@ -53,7 +56,7 @@
5356

5457
return RectorConfig::configure()
5558
->withPhpSets(php82: true)
56-
->withPreparedSets(deadCode: true, instanceOf: true, strictBooleans: true, phpunitCodeQuality: true)
59+
->withPreparedSets(deadCode: true, instanceOf: true, phpunitCodeQuality: true)
5760
->withComposerBased(phpunit: true)
5861
->withParallel(120, 8, 10)
5962
->withCache(
@@ -170,6 +173,25 @@
170173

171174
// possibly isset() on purpose, on updated Config classes property accross versions
172175
IssetOnPropertyObjectToPropertyExistsRector::class,
176+
177+
AssertFuncCallToPHPUnitAssertRector::class => [
178+
// use $this inside static closure
179+
__DIR__ . '/tests/system/AutoReview/FrameworkCodeTest.php',
180+
],
181+
182+
// some tests extended by other tests
183+
FinalizeTestCaseClassRector::class,
184+
185+
DeclareStrictTypesTestsRector::class => [
186+
__DIR__ . '/tests/system/Debug/ExceptionsTest.php',
187+
],
188+
189+
RemoveNullArgOnNullDefaultParamRector::class => [
190+
// skip form query usage, easier to read
191+
__DIR__ . '/system/Model.php',
192+
__DIR__ . '/tests/system/Database',
193+
__DIR__ . '/tests/system/Models',
194+
],
173195
])
174196
// auto import fully qualified class names
175197
->withImportNames(removeUnusedImports: true)
@@ -190,7 +212,6 @@
190212
TernaryEmptyArrayArrayDimFetchToCoalesceRector::class,
191213
DisallowedEmptyRuleFixerRector::class,
192214
PrivatizeFinalClassPropertyRector::class,
193-
BooleanInIfConditionRuleFixerRector::class,
194215
VersionCompareFuncCallToConstantRector::class,
195216
AddClosureVoidReturnTypeWhereNoReturnRector::class,
196217
AddFunctionVoidReturnTypeWhereNoReturnRector::class,
@@ -206,4 +227,4 @@
206227
->withConfiguredRule(RenameConstantRector::class, [
207228
'FILTER_DEFAULT' => 'FILTER_UNSAFE_RAW',
208229
])
209-
->withCodeQualityLevel(54);
230+
->withCodeQualityLevel(61);

system/API/BaseTransformer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ public function __construct(
7373

7474
$fields = $this->request->getGet('fields');
7575
$this->fields = is_string($fields)
76-
? array_map('trim', explode(',', $fields))
76+
? array_map(trim(...), explode(',', $fields))
7777
: $fields;
7878

7979
$includes = $this->request->getGet('include');
8080
$this->includes = is_string($includes)
81-
? array_map('trim', explode(',', $includes))
81+
? array_map(trim(...), explode(',', $includes))
8282
: $includes;
8383
}
8484

@@ -121,7 +121,7 @@ public function transform(array|object|null $resource = null): array
121121
*/
122122
public function transformMany(array $resources): array
123123
{
124-
return array_map(fn ($resource): array => $this->transform($resource), $resources);
124+
return array_map($this->transform(...), $resources);
125125
}
126126

127127
/**

system/Config/Services.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public static function image(?string $handler = null, ?Images $config = null, bo
345345
$config ??= config(Images::class);
346346
assert($config instanceof Images);
347347

348-
$handler = $handler !== null && $handler !== '' && $handler !== '0' ? $handler : $config->defaultHandler;
348+
$handler = in_array($handler, [null, '', '0'], true) ? $config->defaultHandler : $handler;
349349
$class = $config->handlers[$handler];
350350

351351
return new $class($config);
@@ -385,7 +385,7 @@ public static function language(?string $locale = null, bool $getShared = true)
385385
}
386386

387387
// Use '?:' for empty string check
388-
$locale = $locale !== null && $locale !== '' && $locale !== '0' ? $locale : $requestLocale;
388+
$locale = in_array($locale, [null, '', '0'], true) ? $requestLocale : $locale;
389389

390390
return new Language($locale);
391391
}
@@ -484,7 +484,7 @@ public static function parser(?string $viewPath = null, ?ViewConfig $config = nu
484484
return static::getSharedInstance('parser', $viewPath, $config);
485485
}
486486

487-
$viewPath = $viewPath !== null && $viewPath !== '' && $viewPath !== '0' ? $viewPath : (new Paths())->viewDirectory;
487+
$viewPath = in_array($viewPath, [null, '', '0'], true) ? (new Paths())->viewDirectory : $viewPath;
488488
$config ??= config(ViewConfig::class);
489489

490490
return new Parser($config, $viewPath, AppServices::get('locator'), CI_DEBUG, AppServices::get('logger'));
@@ -503,7 +503,7 @@ public static function renderer(?string $viewPath = null, ?ViewConfig $config =
503503
return static::getSharedInstance('renderer', $viewPath, $config);
504504
}
505505

506-
$viewPath = $viewPath !== null && $viewPath !== '' && $viewPath !== '0' ? $viewPath : (new Paths())->viewDirectory;
506+
$viewPath = in_array($viewPath, [null, '', '0'], true) ? (new Paths())->viewDirectory : $viewPath;
507507
$config ??= config(ViewConfig::class);
508508

509509
return new View($config, $viewPath, AppServices::get('locator'), CI_DEBUG, AppServices::get('logger'));

0 commit comments

Comments
 (0)