Skip to content

Commit d945236

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.7
# Conflicts: # rector.php # system/Images/Handlers/ImageMagickHandler.php # tests/system/HTTP/CURLRequestShareOptionsTest.php # utils/phpstan-baseline/loader.neon # utils/phpstan-baseline/missingType.iterableValue.neon # utils/phpstan-baseline/property.notFound.neon
2 parents 6824b69 + 015e3df commit d945236

File tree

69 files changed

+264
-248
lines changed

Some content is hidden

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

69 files changed

+264
-248
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
git commit -m "Update User Guide" -a || true
7676
7777
- name: Push changes
78-
uses: ad-m/github-push-action@v0.6.0
78+
uses: ad-m/github-push-action@v1.0.0
7979
with:
8080
branch: gh-pages
8181
directory: gh-pages

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

rector.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313

1414
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
1515
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
16-
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
17-
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
18-
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
1916
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
2017
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
18+
use Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector;
2119
use Rector\CodeQuality\Rector\Ternary\TernaryEmptyArrayArrayDimFetchToCoalesceRector;
2220
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
2321
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
@@ -169,6 +167,9 @@
169167
CompactToVariablesRector::class,
170168

171169
RemoveDataProviderParamKeysRector::class,
170+
171+
// possibly isset() on purpose, on updated Config classes property accross versions
172+
IssetOnPropertyObjectToPropertyExistsRector::class,
172173
])
173174
// auto import fully qualified class names
174175
->withImportNames(removeUnusedImports: true)
@@ -181,10 +182,7 @@
181182
CountArrayToEmptyArrayComparisonRector::class,
182183
ChangeNestedForeachIfsToEarlyContinueRector::class,
183184
ChangeIfElseValueAssignToEarlyReturnRector::class,
184-
InlineIfToExplicitIfRector::class,
185185
PreparedValueToEarlyReturnRector::class,
186-
UnusedForeachValueToArrayKeysRector::class,
187-
ChangeArrayPushToArrayAssignRector::class,
188186
RemoveErrorSuppressInTryCatchStmtsRector::class,
189187
FuncGetArgsToVariadicParamRector::class,
190188
MakeInheritedMethodVisibilitySameAsParentRector::class,
@@ -208,4 +206,4 @@
208206
->withConfiguredRule(RenameConstantRector::class, [
209207
'FILTER_DEFAULT' => 'FILTER_UNSAFE_RAW',
210208
])
211-
->withCodeQualityLevel(34);
209+
->withCodeQualityLevel(54);

system/API/ResponseTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ protected function respond($data = null, ?int $status = null, string $message =
122122
/**
123123
* Used for generic failures that no custom methods exist for.
124124
*
125-
* @param list<string>|string $messages
126-
* @param int $status HTTP status code
127-
* @param string|null $code Custom, API-specific, error code
125+
* @param array<array-key, string>|string $messages
126+
* @param int $status HTTP status code
127+
* @param string|null $code Custom, API-specific, error code
128128
*
129129
* @return ResponseInterface
130130
*/
@@ -230,7 +230,7 @@ protected function failNotFound(string $description = 'Not Found', ?string $code
230230
/**
231231
* Used when the data provided by the client cannot be validated on one or more fields.
232232
*
233-
* @param list<string>|string $errors
233+
* @param array<array-key, string>|string $errors
234234
*
235235
* @return ResponseInterface
236236
*/

system/BaseModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ protected function shouldUpdate($row): bool
770770
{
771771
$id = $this->getIdValue($row);
772772

773-
return ! ($id === null || $id === [] || $id === '');
773+
return ! in_array($id, [null, [], ''], true);
774774
}
775775

776776
/**

system/CLI/BaseCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function showHelp()
142142
{
143143
CLI::write(lang('CLI.helpUsage'), 'yellow');
144144

145-
if (isset($this->usage)) {
145+
if ($this->usage !== null) {
146146
$usage = $this->usage;
147147
} else {
148148
$usage = $this->name;
@@ -154,7 +154,7 @@ public function showHelp()
154154

155155
CLI::write($this->setPad($usage, 0, 0, 2));
156156

157-
if (isset($this->description)) {
157+
if ($this->description !== null) {
158158
CLI::newLine();
159159
CLI::write(lang('CLI.helpDescription'), 'yellow');
160160
CLI::write($this->setPad($this->description, 0, 0, 2));

system/CLI/CLI.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,7 @@ public static function promptByMultipleKeys(string $text, array $options): array
318318
if ($opts === []) {
319319
$extraOutput = $extraOutputDefault;
320320
} else {
321-
$optsKey = [];
322-
323-
foreach (array_keys($opts) as $key) {
324-
$optsKey[] = $key;
325-
}
321+
$optsKey = array_keys($opts);
326322
$extraOutput = '[' . $extraOutputDefault . ', ' . implode(', ', $optsKey) . ']';
327323
$extraOutput = 'You can specify multiple values separated by commas.' . PHP_EOL . $extraOutput;
328324
}

system/CLI/Commands.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function discoverCommands()
129129

130130
$class = new $className($this->logger, $this);
131131

132-
if (isset($class->group) && ! isset($this->commands[$class->name])) {
132+
if ($class->group !== null && ! isset($this->commands[$class->name])) {
133133
$this->commands[$class->name] = [
134134
'class' => $className,
135135
'file' => $file,

system/Commands/Database/CreateDatabase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function run(array $params)
109109
$config->{$group}['database'] = $name;
110110

111111
if ($name !== ':memory:') {
112-
$dbName = ! str_contains($name, DIRECTORY_SEPARATOR) ? WRITEPATH . $name : $name;
112+
$dbName = str_contains($name, DIRECTORY_SEPARATOR) ? $name : WRITEPATH . $name;
113113

114114
if (is_file($dbName)) {
115115
CLI::error("Database \"{$dbName}\" already exists.", 'light_gray', 'red');

system/Common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ function stringify_attributes($attributes, bool $js = false): string
11721172
{
11731173
$atts = '';
11741174

1175-
if ($attributes === '' || $attributes === [] || $attributes === null) {
1175+
if (in_array($attributes, ['', [], null], true)) {
11761176
return $atts;
11771177
}
11781178

0 commit comments

Comments
 (0)