Skip to content

Commit 1938a7c

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.6
2 parents 388fed8 + 83d1bd9 commit 1938a7c

File tree

9 files changed

+17
-35
lines changed

9 files changed

+17
-35
lines changed

.github/workflows/label-add-conflict-all-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ jobs:
4646
gh pr edit $url --add-label "stale"
4747
4848
# Add a comment
49-
gh pr comment $url --body ":wave: Hi, @$author!<br><br>We detected conflicts in your PR against the base branch :speak_no_evil:<br>You may want to sync :arrows_counterclockwise: your branch with upstream!<br><br>Ref: [Syncing Your Branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#pushing-your-branch)"
49+
gh pr comment $url --body ":wave: Hi, @$author!<br><br>We detected conflicts in your PR against the base branch :speak_no_evil:<br>You may want to sync :arrows_counterclockwise: your branch with upstream!<br><br>Ref: [Syncing Your Branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#updating-your-branch)"
5050
fi
5151
done

phpstan-baseline.php

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@
14741474
$ignoreErrors[] = [
14751475
// identifier: empty.notAllowed
14761476
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
1477-
'count' => 30,
1477+
'count' => 29,
14781478
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
14791479
];
14801480
$ignoreErrors[] = [
@@ -1921,6 +1921,12 @@
19211921
'count' => 1,
19221922
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
19231923
];
1924+
$ignoreErrors[] = [
1925+
// identifier: isset.offset
1926+
'message' => '#^Offset 4 on array\\{string, string, string, string, string, string\\} in isset\\(\\) always exists and is not nullable\\.$#',
1927+
'count' => 1,
1928+
'path' => __DIR__ . '/system/Database/BaseBuilder.php',
1929+
];
19241930
$ignoreErrors[] = [
19251931
// identifier: booleanNot.exprNotBoolean
19261932
'message' => '#^Only booleans are allowed in a negated boolean, TWhenNot given\\.$#',
@@ -11313,7 +11319,7 @@
1131311319
];
1131411320
$ignoreErrors[] = [
1131511321
// identifier: codeigniter.superglobalAccessAssign
11316-
'message' => '#^Assigning mixed directly on offset \'CONTENT_TYPE\' of \\$_SERVER is discouraged\\.$#',
11322+
'message' => '#^Assigning string directly on offset \'CONTENT_TYPE\' of \\$_SERVER is discouraged\\.$#',
1131711323
'count' => 1,
1131811324
'path' => __DIR__ . '/tests/system/API/ResponseTraitTest.php',
1131911325
];
@@ -11347,18 +11353,6 @@
1134711353
'count' => 1,
1134811354
'path' => __DIR__ . '/tests/system/API/ResponseTraitTest.php',
1134911355
];
11350-
$ignoreErrors[] = [
11351-
// identifier: missingType.parameter
11352-
'message' => '#^Method CodeIgniter\\\\API\\\\ResponseTraitTest\\:\\:tryValidContentType\\(\\) has parameter \\$contentType with no type specified\\.$#',
11353-
'count' => 1,
11354-
'path' => __DIR__ . '/tests/system/API/ResponseTraitTest.php',
11355-
];
11356-
$ignoreErrors[] = [
11357-
// identifier: missingType.parameter
11358-
'message' => '#^Method CodeIgniter\\\\API\\\\ResponseTraitTest\\:\\:tryValidContentType\\(\\) has parameter \\$mimeType with no type specified\\.$#',
11359-
'count' => 1,
11360-
'path' => __DIR__ . '/tests/system/API/ResponseTraitTest.php',
11361-
];
1136211356
$ignoreErrors[] = [
1136311357
// identifier: missingType.parameter
1136411358
'message' => '#^Method class@anonymous/tests/system/API/ResponseTraitTest\\.php\\:116\\:\\:__construct\\(\\) has parameter \\$formatter with no type specified\\.$#',
@@ -16633,12 +16627,6 @@
1663316627
'count' => 1,
1663416628
'path' => __DIR__ . '/tests/system/RESTful/ResourcePresenterTest.php',
1663516629
];
16636-
$ignoreErrors[] = [
16637-
// identifier: missingType.parameter
16638-
'message' => '#^Method CodeIgniter\\\\Router\\\\AutoRouterImprovedTest\\:\\:createNewAutoRouter\\(\\) has parameter \\$namespace with no type specified\\.$#',
16639-
'count' => 1,
16640-
'path' => __DIR__ . '/tests/system/Router/AutoRouterImprovedTest.php',
16641-
];
1664216630
$ignoreErrors[] = [
1664316631
// identifier: missingType.iterableValue
1664416632
'message' => '#^Method CodeIgniter\\\\Router\\\\AutoRouterImprovedTest\\:\\:provideRejectTranslateUriToCamelCase\\(\\) return type has no value type specified in iterable type iterable\\.$#',
@@ -17059,12 +17047,6 @@
1705917047
'count' => 1,
1706017048
'path' => __DIR__ . '/tests/system/Test/BootstrapFCPATHTest.php',
1706117049
];
17062-
$ignoreErrors[] = [
17063-
// identifier: missingType.parameter
17064-
'message' => '#^Method CodeIgniter\\\\Test\\\\BootstrapFCPATHTest\\:\\:readOutput\\(\\) has parameter \\$file with no type specified\\.$#',
17065-
'count' => 1,
17066-
'path' => __DIR__ . '/tests/system/Test/BootstrapFCPATHTest.php',
17067-
];
1706817050
$ignoreErrors[] = [
1706917051
// identifier: method.notFound
1707017052
'message' => '#^Call to an undefined method CodeIgniter\\\\Test\\\\TestResponse\\:\\:ohno\\(\\)\\.$#',

rector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
5151
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
5252
use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector;
53+
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
5354
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
5455
use Rector\TypeDeclaration\Rector\Closure\AddClosureVoidReturnTypeWhereNoReturnRector;
5556
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
@@ -213,6 +214,7 @@
213214
ExplicitBoolCompareRector::class,
214215
AddClosureVoidReturnTypeWhereNoReturnRector::class,
215216
AddFunctionVoidReturnTypeWhereNoReturnRector::class,
217+
AddMethodCallBasedStrictParamTypeRector::class,
216218
])
217219
->withConfiguredRule(StringClassNameToClassConstantRector::class, [
218220
// keep '\\' prefix string on string '\Foo\Bar'

system/Database/BaseBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3183,7 +3183,7 @@ protected function compileWhereHaving(string $qbKey): string
31833183
// 5 => ')' /* optional */
31843184
// );
31853185

3186-
if (! empty($matches[4])) {
3186+
if (isset($matches[4]) && $matches[4] !== '' && $matches[4] !== '0') {
31873187
$protectIdentifiers = false;
31883188
if (str_contains($matches[4], '.')) {
31893189
$protectIdentifiers = true;

system/Database/Postgre/Builder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,8 @@ static function ($key, $value) use ($table, $alias, $that) {
411411
* Returns cast expression.
412412
*
413413
* @TODO move this to BaseBuilder in 4.5.0
414-
*
415-
* @param float|int|string $expression
416414
*/
417-
private function cast($expression, ?string $type): string
415+
private function cast(string $expression, ?string $type): string
418416
{
419417
return ($type === null) ? $expression : 'CAST(' . $expression . ' AS ' . strtoupper($type) . ')';
420418
}

tests/system/API/ResponseTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public function testValidContentTypes(): void
556556
}
557557
}
558558

559-
private function tryValidContentType($mimeType, $contentType): void
559+
private function tryValidContentType(string $mimeType, string $contentType): void
560560
{
561561
$original = $_SERVER;
562562
$_SERVER['CONTENT_TYPE'] = $mimeType;

tests/system/Router/AutoRouterImprovedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function setUp(): void
4545
$this->collection = new RouteCollection(Services::locator(), $moduleConfig, new Routing());
4646
}
4747

48-
private function createNewAutoRouter($namespace = 'CodeIgniter\Router\Controllers'): AutoRouterImproved
48+
private function createNewAutoRouter(string $namespace = 'CodeIgniter\Router\Controllers'): AutoRouterImproved
4949
{
5050
return new AutoRouterImproved(
5151
[],

tests/system/Test/BootstrapFCPATHTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function fileContents()
102102
return $fileContents . ('echo FCPATH;' . PHP_EOL);
103103
}
104104

105-
private function readOutput($file)
105+
private function readOutput(string $file)
106106
{
107107
ob_start();
108108
system('php -f ' . $file);

utils/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"php": "^8.1",
44
"codeigniter/coding-standard": "^1.7",
55
"ergebnis/composer-normalize": "^2.28",
6-
"friendsofphp/php-cs-fixer": "3.62.*",
6+
"friendsofphp/php-cs-fixer": "^3.63.2",
77
"nexusphp/cs-config": "^3.6",
88
"phpmetrics/phpmetrics": "^2.8 || ^3.0rc6",
99
"vimeo/psalm": "^5.0"

0 commit comments

Comments
 (0)