Skip to content

Commit 5ef7fa2

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
2 parents 8414e8a + a05cae4 commit 5ef7fa2

File tree

9 files changed

+38
-82
lines changed

9 files changed

+38
-82
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -226,71 +226,6 @@
226226
'count' => 6,
227227
'path' => __DIR__ . '/system/CodeIgniter.php',
228228
];
229-
$ignoreErrors[] = [
230-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:bootstrapEnvironment\\(\\) has no return type specified\\.$#',
231-
'count' => 1,
232-
'path' => __DIR__ . '/system/CodeIgniter.php',
233-
];
234-
$ignoreErrors[] = [
235-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:callExit\\(\\) has no return type specified\\.$#',
236-
'count' => 1,
237-
'path' => __DIR__ . '/system/CodeIgniter.php',
238-
];
239-
$ignoreErrors[] = [
240-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:detectEnvironment\\(\\) has no return type specified\\.$#',
241-
'count' => 1,
242-
'path' => __DIR__ . '/system/CodeIgniter.php',
243-
];
244-
$ignoreErrors[] = [
245-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:forceSecureAccess\\(\\) has no return type specified\\.$#',
246-
'count' => 1,
247-
'path' => __DIR__ . '/system/CodeIgniter.php',
248-
];
249-
$ignoreErrors[] = [
250-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:gatherOutput\\(\\) has no return type specified\\.$#',
251-
'count' => 1,
252-
'path' => __DIR__ . '/system/CodeIgniter.php',
253-
];
254-
$ignoreErrors[] = [
255-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:getRequestObject\\(\\) has no return type specified\\.$#',
256-
'count' => 1,
257-
'path' => __DIR__ . '/system/CodeIgniter.php',
258-
];
259-
$ignoreErrors[] = [
260-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:getResponseObject\\(\\) has no return type specified\\.$#',
261-
'count' => 1,
262-
'path' => __DIR__ . '/system/CodeIgniter.php',
263-
];
264-
$ignoreErrors[] = [
265-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:initialize\\(\\) has no return type specified\\.$#',
266-
'count' => 1,
267-
'path' => __DIR__ . '/system/CodeIgniter.php',
268-
];
269-
$ignoreErrors[] = [
270-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:initializeKint\\(\\) has no return type specified\\.$#',
271-
'count' => 1,
272-
'path' => __DIR__ . '/system/CodeIgniter.php',
273-
];
274-
$ignoreErrors[] = [
275-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:resolvePlatformExtensions\\(\\) has no return type specified\\.$#',
276-
'count' => 1,
277-
'path' => __DIR__ . '/system/CodeIgniter.php',
278-
];
279-
$ignoreErrors[] = [
280-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:spoofRequestMethod\\(\\) has no return type specified\\.$#',
281-
'count' => 1,
282-
'path' => __DIR__ . '/system/CodeIgniter.php',
283-
];
284-
$ignoreErrors[] = [
285-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:startBenchmark\\(\\) has no return type specified\\.$#',
286-
'count' => 1,
287-
'path' => __DIR__ . '/system/CodeIgniter.php',
288-
];
289-
$ignoreErrors[] = [
290-
'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:storePreviousURL\\(\\) has no return type specified\\.$#',
291-
'count' => 1,
292-
'path' => __DIR__ . '/system/CodeIgniter.php',
293-
];
294229
$ignoreErrors[] = [
295230
'message' => '#^Only booleans are allowed in an if condition, CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null given\\.$#',
296231
'count' => 1,
@@ -3806,11 +3741,6 @@
38063741
'count' => 2,
38073742
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
38083743
];
3809-
$ignoreErrors[] = [
3810-
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockCodeIgniter\\:\\:callExit\\(\\) has no return type specified\\.$#',
3811-
'count' => 1,
3812-
'path' => __DIR__ . '/system/Test/Mock/MockCodeIgniter.php',
3813-
];
38143744
$ignoreErrors[] = [
38153745
'message' => '#^Cannot access property \\$insert_id on object\\|resource\\|false\\.$#',
38163746
'count' => 1,

system/BaseModel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,8 @@ public function setValidationRule(string $field, $fieldRules)
14391439
if (is_string($rules)) {
14401440
[$rules, $customErrors] = $this->validation->loadRuleGroup($rules);
14411441

1442-
$this->validationRules = $rules;
1443-
$this->validationMessages = $this->validationMessages + $customErrors;
1442+
$this->validationRules = $rules;
1443+
$this->validationMessages += $customErrors;
14441444
}
14451445

14461446
$this->validationRules[$field] = $fieldRules;
@@ -1510,7 +1510,7 @@ public function getValidationRules(array $options = []): array
15101510
if (is_string($rules)) {
15111511
[$rules, $customErrors] = $this->validation->loadRuleGroup($rules);
15121512

1513-
$this->validationMessages = $this->validationMessages + $customErrors;
1513+
$this->validationMessages += $customErrors;
15141514
}
15151515

15161516
if (isset($options['except'])) {

system/CLI/CLI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ public static function wrap(?string $string = null, int $max = 0, int $padLeft =
851851
$max = self::getWidth();
852852
}
853853

854-
$max = $max - $padLeft;
854+
$max -= $padLeft;
855855

856856
$lines = wordwrap($string, $max, PHP_EOL);
857857

@@ -1079,7 +1079,7 @@ public static function table(array $tbody, array $thead = [])
10791079
$diff = $maxColsLengths[$column] - static::strlen($col);
10801080

10811081
if ($diff) {
1082-
$tableRows[$row][$column] = $tableRows[$row][$column] . str_repeat(' ', $diff);
1082+
$tableRows[$row][$column] .= str_repeat(' ', $diff);
10831083
}
10841084

10851085
$column++;

system/CodeIgniter.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ public function __construct(App $config)
197197

198198
/**
199199
* Handles some basic app and environment setup.
200+
*
201+
* @return void
200202
*/
201203
public function initialize()
202204
{
@@ -223,6 +225,8 @@ public function initialize()
223225
/**
224226
* Checks system for missing required PHP extensions.
225227
*
228+
* @return void
229+
*
226230
* @throws FrameworkException
227231
*
228232
* @codeCoverageIgnore
@@ -250,6 +254,8 @@ protected function resolvePlatformExtensions()
250254

251255
/**
252256
* Initializes Kint
257+
*
258+
* @return void
253259
*/
254260
protected function initializeKint()
255261
{
@@ -556,6 +562,8 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
556562
*
557563
* @codeCoverageIgnore
558564
*
565+
* @return void
566+
*
559567
* @deprecated 4.4.0 No longer used. Moved to index.php and spark.
560568
*/
561569
protected function detectEnvironment()
@@ -571,6 +579,8 @@ protected function detectEnvironment()
571579
*
572580
* If no boot file exists, we shouldn't continue because something
573581
* is wrong. At the very least, they should have error reporting setup.
582+
*
583+
* @return void
574584
*/
575585
protected function bootstrapEnvironment()
576586
{
@@ -591,6 +601,8 @@ protected function bootstrapEnvironment()
591601
*
592602
* The timer is used to display total script execution both in the
593603
* debug toolbar, and potentially on the displayed page.
604+
*
605+
* @return void
594606
*/
595607
protected function startBenchmark()
596608
{
@@ -620,6 +632,8 @@ public function setRequest($request)
620632

621633
/**
622634
* Get our Request object, (either IncomingRequest or CLIRequest).
635+
*
636+
* @return void
623637
*/
624638
protected function getRequestObject()
625639
{
@@ -639,6 +653,8 @@ protected function getRequestObject()
639653
/**
640654
* Get our Response object, and set some default values, including
641655
* the HTTP protocol version and a default successful response.
656+
*
657+
* @return void
642658
*/
643659
protected function getResponseObject()
644660
{
@@ -661,6 +677,8 @@ protected function getResponseObject()
661677
*
662678
* @param int $duration How long the Strict Transport Security
663679
* should be enforced for this URL.
680+
*
681+
* @return void
664682
*/
665683
protected function forceSecureAccess($duration = 31_536_000)
666684
{
@@ -964,6 +982,8 @@ protected function display404errors(PageNotFoundException $e)
964982
* @param ResponseInterface|string|null $returned
965983
*
966984
* @deprecated $cacheConfig is deprecated.
985+
*
986+
* @return void
967987
*/
968988
protected function gatherOutput(?Cache $cacheConfig = null, $returned = null)
969989
{
@@ -1000,6 +1020,8 @@ protected function gatherOutput(?Cache $cacheConfig = null, $returned = null)
10001020
* This helps provider safer, more reliable previous_url() detection.
10011021
*
10021022
* @param string|URI $uri
1023+
*
1024+
* @return void
10031025
*/
10041026
public function storePreviousURL($uri)
10051027
{
@@ -1041,6 +1063,8 @@ public function storePreviousURL($uri)
10411063
/**
10421064
* Modifies the Request Object to use a different method if a POST
10431065
* variable called _method is found.
1066+
*
1067+
* @return void
10441068
*/
10451069
public function spoofRequestMethod()
10461070
{
@@ -1082,6 +1106,8 @@ protected function sendResponse()
10821106
* @param int $code
10831107
*
10841108
* @deprecated 4.4.0 No longer Used. Moved to index.php.
1109+
*
1110+
* @return void
10851111
*/
10861112
protected function callExit($code)
10871113
{

system/Format/JSONFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function format($data)
3333
$config = new Format();
3434

3535
$options = $config->formatterOptions['application/json'] ?? JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES;
36-
$options = $options | JSON_PARTIAL_OUTPUT_ON_ERROR;
36+
$options |= JSON_PARTIAL_OUTPUT_ON_ERROR;
3737

3838
$options = ENVIRONMENT === 'production' ? $options : $options | JSON_PRETTY_PRINT;
3939

system/Images/Handlers/GDHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,11 @@ protected function _text(string $text, array $options = [])
381381
// offset flips itself automatically
382382

383383
if ($options['vAlign'] === 'bottom') {
384-
$options['vOffset'] = $options['vOffset'] * -1;
384+
$options['vOffset'] *= -1;
385385
}
386386

387387
if ($options['hAlign'] === 'right') {
388-
$options['hOffset'] = $options['hOffset'] * -1;
388+
$options['hOffset'] *= -1;
389389
}
390390

391391
// Set font width and height

system/Images/Handlers/ImageMagickHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ protected function _text(string $text, array $options = [])
340340
// invert the offset. Note: The horizontal
341341
// offset flips itself automatically
342342
if ($options['vAlign'] === 'bottom') {
343-
$options['vOffset'] = $options['vOffset'] * -1;
343+
$options['vOffset'] *= -1;
344344
}
345345

346346
if ($options['hAlign'] === 'right') {
347-
$options['hOffset'] = $options['hOffset'] * -1;
347+
$options['hOffset'] *= -1;
348348
}
349349

350350
// Font

system/Throttle/Throttler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function check(string $key, int $capacity, int $seconds, int $cost = 1):
127127
// If $tokens >= 1, then we are safe to perform the action, but
128128
// we need to decrement the number of available tokens.
129129
if ($tokens >= 1) {
130-
$tokens = $tokens - $cost;
130+
$tokens -= $cost;
131131
$this->cache->save($tokenName, $tokens, $seconds);
132132
$this->cache->save($tokenName . 'Time', $this->time(), $seconds);
133133

tests/_support/View/Cells/MultiplierCell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ class MultiplierCell extends Cell
2020

2121
public function mount(): void
2222
{
23-
$this->value = $this->value * $this->multiplier;
23+
$this->value *= $this->multiplier;
2424
}
2525
}

0 commit comments

Comments
 (0)