Skip to content

Commit 115d37e

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.7
2 parents 7d8e085 + 92ff74e commit 115d37e

File tree

17 files changed

+121
-222
lines changed

17 files changed

+121
-222
lines changed

admin/starter/tests/_support/Libraries/ConfigReader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
namespace Tests\Support\Libraries;
44

5+
use Config\App;
6+
57
/**
68
* Class ConfigReader
79
*
810
* An extension of BaseConfig that prevents the constructor from
911
* loading external values. Used to read actual local values from
1012
* a config file.
1113
*/
12-
class ConfigReader extends \Config\App
14+
class ConfigReader extends App
1315
{
1416
public function __construct()
1517
{

preload.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12+
use CodeIgniter\Boot;
13+
use Config\Paths;
14+
1215
/*
1316
*---------------------------------------------------------------
1417
* Sample file for Preloading
@@ -69,10 +72,10 @@ public function __construct()
6972

7073
private function loadAutoloader(): void
7174
{
72-
$paths = new Config\Paths();
75+
$paths = new Paths();
7376
require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'Boot.php';
7477

75-
CodeIgniter\Boot::preload($paths);
78+
Boot::preload($paths);
7679
}
7780

7881
/**

public/index.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
use CodeIgniter\Boot;
4+
use Config\Paths;
5+
36
/*
47
*---------------------------------------------------------------
58
* CHECK PHP VERSION
@@ -48,9 +51,9 @@
4851
require FCPATH . '../app/Config/Paths.php';
4952
// ^^^ Change this line if you move your application folder
5053

51-
$paths = new Config\Paths();
54+
$paths = new Paths();
5255

5356
// LOAD THE FRAMEWORK BOOTSTRAP FILE
5457
require $paths->systemDirectory . '/Boot.php';
5558

56-
exit(CodeIgniter\Boot::bootWeb($paths));
59+
exit(Boot::bootWeb($paths));

spark

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
* the LICENSE file that was distributed with this source code.
1111
*/
1212

13+
use CodeIgniter\Boot;
14+
use Config\Paths;
15+
1316
/*
1417
* --------------------------------------------------------------------
1518
* CODEIGNITER COMMAND-LINE TOOLS
@@ -76,9 +79,9 @@ chdir(FCPATH);
7679
require FCPATH . '../app/Config/Paths.php';
7780
// ^^^ Change this line if you move your application folder
7881

79-
$paths = new Config\Paths();
82+
$paths = new Paths();
8083

8184
// LOAD THE FRAMEWORK BOOTSTRAP FILE
8285
require $paths->systemDirectory . '/Boot.php';
8386

84-
exit(CodeIgniter\Boot::bootSpark($paths));
87+
exit(Boot::bootSpark($paths));

system/Autoloader/Autoloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function initialize(Autoload $config, Modules $modules)
123123
$this->files = $config->files;
124124
}
125125

126-
if (isset($config->helpers)) {
126+
if ($config->helpers !== []) {
127127
$this->helpers = [...$this->helpers, ...$config->helpers];
128128
}
129129

system/Debug/Toolbar/Views/toolbar.tpl.php

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
<?php declare(strict_types=1);
2+
use CodeIgniter\Debug\Toolbar;
3+
use CodeIgniter\View\Parser;
4+
25
/**
3-
* @var CodeIgniter\Debug\Toolbar $this
4-
* @var int $totalTime
5-
* @var int $totalMemory
6-
* @var string $url
7-
* @var string $method
8-
* @var bool $isAJAX
9-
* @var int $startTime
10-
* @var int $totalTime
11-
* @var int $totalMemory
12-
* @var float $segmentDuration
13-
* @var int $segmentCount
14-
* @var string $CI_VERSION
15-
* @var array $collectors
16-
* @var array $vars
17-
* @var array $styles
18-
* @var CodeIgniter\View\Parser $parser
6+
* @var Toolbar $this
7+
* @var int $totalTime
8+
* @var int $totalMemory
9+
* @var string $url
10+
* @var string $method
11+
* @var bool $isAJAX
12+
* @var int $startTime
13+
* @var int $totalTime
14+
* @var int $totalMemory
15+
* @var float $segmentDuration
16+
* @var int $segmentCount
17+
* @var string $CI_VERSION
18+
* @var array $collectors
19+
* @var array $vars
20+
* @var array $styles
21+
* @var Parser $parser
1922
*/
2023
?>
2124
<style>

system/Email/Email.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ class Email
398398
/**
399399
* mbstring.func_overload flag
400400
*
401-
* @var bool
401+
* @var bool|null
402402
*/
403403
protected static $func_overload;
404404

@@ -408,8 +408,9 @@ class Email
408408
public function __construct($config = null)
409409
{
410410
$this->initialize($config);
411+
411412
if (! isset(static::$func_overload)) {
412-
static::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
413+
static::$func_overload = extension_loaded('mbstring') && ini_get('mbstring.func_overload');
413414
}
414415
}
415416

system/HTTP/RedirectResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public function withInput()
9393
{
9494
$session = service('session');
9595
$session->setFlashdata('_ci_old_input', [
96-
'get' => $_GET ?? [],
97-
'post' => $_POST ?? [],
96+
'get' => $_GET ?? [], // @phpstan-ignore nullCoalesce.variable
97+
'post' => $_POST ?? [], // @phpstan-ignore nullCoalesce.variable
9898
]);
9999

100100
$this->withErrors();

system/Session/Session.php

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ public function start()
233233
$this->setSaveHandler();
234234

235235
// Sanitize the cookie, because apparently PHP doesn't do that for userspace handlers
236-
if (isset($_COOKIE[$this->config->cookieName])
236+
if (
237+
isset($_COOKIE[$this->config->cookieName])
237238
&& (! is_string($_COOKIE[$this->config->cookieName]) || preg_match('#\A' . $this->sidRegexp . '\z#', $_COOKIE[$this->config->cookieName]) !== 1)
238239
) {
239240
unset($_COOKIE[$this->config->cookieName]);
@@ -267,6 +268,8 @@ public function start()
267268
* Destroys the current session.
268269
*
269270
* @deprecated Use destroy() instead.
271+
*
272+
* @return void
270273
*/
271274
public function stop()
272275
{
@@ -277,6 +280,8 @@ public function stop()
277280
* Configuration.
278281
*
279282
* Handle input binds and configuration defaults.
283+
*
284+
* @return void
280285
*/
281286
protected function configure()
282287
{
@@ -318,6 +323,8 @@ protected function configure()
318323
*
319324
* To make life easier, we force the PHP defaults. Because PHP9 forces them.
320325
* See https://wiki.php.net/rfc/deprecations_php_8_4#sessionsid_length_and_sessionsid_bits_per_character
326+
*
327+
* @return void
321328
*/
322329
protected function configureSidLength()
323330
{
@@ -342,6 +349,8 @@ protected function configureSidLength()
342349
*
343350
* Clears old "flash" data, marks the new one for deletion and handles
344351
* "temp" data deletion.
352+
*
353+
* @return void
345354
*/
346355
protected function initVars()
347356
{
@@ -370,6 +379,8 @@ protected function initVars()
370379
* Regenerates the session ID.
371380
*
372381
* @param bool $destroy Should old session data be destroyed?
382+
*
383+
* @return void
373384
*/
374385
public function regenerate(bool $destroy = false)
375386
{
@@ -401,6 +412,8 @@ private function removeOldSessionCookie(): void
401412

402413
/**
403414
* Destroys the current session.
415+
*
416+
* @return void
404417
*/
405418
public function destroy()
406419
{
@@ -436,6 +449,8 @@ public function close()
436449
*
437450
* @param array|string $data Property name or associative array of properties
438451
* @param array|bool|float|int|object|string|null $value Property value if single key provided
452+
*
453+
* @return void
439454
*/
440455
public function set($data, $value = null)
441456
{
@@ -510,6 +525,8 @@ public function has(string $key): bool
510525
*
511526
* @param string $key Identifier of the session property we are interested in.
512527
* @param array $data value to be pushed to existing session key.
528+
*
529+
* @return void
513530
*/
514531
public function push(string $key, array $data)
515532
{
@@ -526,6 +543,8 @@ public function push(string $key, array $data)
526543
* of a specific session property to remove.
527544
*
528545
* @param array|string $key Identifier of the session property or properties to remove.
546+
*
547+
* @return void
529548
*/
530549
public function remove($key)
531550
{
@@ -598,6 +617,8 @@ public function __isset(string $key): bool
598617
*
599618
* @param array|string $data Property identifier or associative array of properties
600619
* @param array|bool|float|int|object|string|null $value Property value if $data is a scalar
620+
*
621+
* @return void
601622
*/
602623
public function setFlashdata($data, $value = null)
603624
{
@@ -638,6 +659,8 @@ public function getFlashdata(?string $key = null)
638659
* Keeps a single piece of flash data alive for one more request.
639660
*
640661
* @param array|string $key Property identifier or array of them
662+
*
663+
* @return void
641664
*/
642665
public function keepFlashdata($key)
643666
{
@@ -680,6 +703,8 @@ public function markAsFlashdata($key): bool
680703
* Unmark data in the session as flashdata.
681704
*
682705
* @param array|string $key Property identifier or array of them
706+
*
707+
* @return void
683708
*/
684709
public function unmarkFlashdata($key)
685710
{
@@ -731,6 +756,8 @@ public function getFlashKeys(): array
731756
* @param array|string $data Session data key or associative array of items
732757
* @param array|bool|float|int|object|string|null $value Value to store
733758
* @param int $ttl Time-to-live in seconds
759+
*
760+
* @return void
734761
*/
735762
public function setTempdata($data, $value = null, int $ttl = 300)
736763
{
@@ -750,7 +777,7 @@ public function getTempdata(?string $key = null)
750777
{
751778
if (isset($key)) {
752779
return (isset($_SESSION['__ci_vars'], $_SESSION['__ci_vars'][$key], $_SESSION[$key])
753-
&& is_int($_SESSION['__ci_vars'][$key])) ? $_SESSION[$key] : null;
780+
&& is_int($_SESSION['__ci_vars'][$key])) ? $_SESSION[$key] : null;
754781
}
755782

756783
$tempdata = [];
@@ -770,6 +797,8 @@ public function getTempdata(?string $key = null)
770797
* Removes a single piece of temporary data from the session.
771798
*
772799
* @param string $key Session data key
800+
*
801+
* @return void
773802
*/
774803
public function removeTempdata(string $key)
775804
{
@@ -830,6 +859,8 @@ public function markAsTempdata($key, int $ttl = 300): bool
830859
* lifespan and allowing it to live as long as the session does.
831860
*
832861
* @param array|string $key Property identifier or array of them
862+
*
863+
* @return void
833864
*/
834865
public function unmarkTempdata($key)
835866
{
@@ -875,6 +906,8 @@ public function getTempKeys(): array
875906
/**
876907
* Sets the driver as the session handler in PHP.
877908
* Extracted for easier testing.
909+
*
910+
* @return void
878911
*/
879912
protected function setSaveHandler()
880913
{
@@ -884,6 +917,8 @@ protected function setSaveHandler()
884917
/**
885918
* Starts the session.
886919
* Extracted for testing reasons.
920+
*
921+
* @return void
887922
*/
888923
protected function startSession()
889924
{
@@ -900,6 +935,8 @@ protected function startSession()
900935
* Takes care of setting the cookie on the client side.
901936
*
902937
* @codeCoverageIgnore
938+
*
939+
* @return void
903940
*/
904941
protected function setCookie()
905942
{

0 commit comments

Comments
 (0)