Skip to content

Commit 872c8fb

Browse files
committed
Release v4.2.6
1 parent 26ebf14 commit 872c8fb

38 files changed

+290
-223
lines changed

app/Config/App.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ class App extends BaseConfig
437437
* Defaults to `Lax` as recommended in this link:
438438
*
439439
* @see https://portswigger.net/web-security/csrf/samesite-cookies
440+
*
440441
* @deprecated `Config\Cookie` $samesite property is used.
441442
*
442443
* @var string

app/Config/ContentSecurityPolicy.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616
class ContentSecurityPolicy extends BaseConfig
1717
{
18-
//-------------------------------------------------------------------------
18+
// -------------------------------------------------------------------------
1919
// Broadbrush CSP management
20-
//-------------------------------------------------------------------------
20+
// -------------------------------------------------------------------------
2121

2222
/**
2323
* Default CSP report context
@@ -43,10 +43,10 @@ class ContentSecurityPolicy extends BaseConfig
4343
*/
4444
public $upgradeInsecureRequests = false;
4545

46-
//-------------------------------------------------------------------------
46+
// -------------------------------------------------------------------------
4747
// Sources allowed
4848
// Note: once you set a policy to 'none', it cannot be further restricted
49-
//-------------------------------------------------------------------------
49+
// -------------------------------------------------------------------------
5050

5151
/**
5252
* Will default to self if not overridden

app/Config/Routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// where controller filters or CSRF protection are bypassed.
2626
// If you don't want to define all routes, please use the Auto Routing (Improved).
2727
// Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true.
28-
//$routes->setAutoRoute(false);
28+
// $routes->setAutoRoute(false);
2929

3030
/*
3131
* --------------------------------------------------------------------

app/Config/Validation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
class Validation extends BaseConfig
1212
{
13-
//--------------------------------------------------------------------
13+
// --------------------------------------------------------------------
1414
// Setup
15-
//--------------------------------------------------------------------
15+
// --------------------------------------------------------------------
1616

1717
/**
1818
* Stores the classes that contain the
@@ -38,7 +38,7 @@ class Validation extends BaseConfig
3838
'single' => 'CodeIgniter\Validation\Views\single',
3939
];
4040

41-
//--------------------------------------------------------------------
41+
// --------------------------------------------------------------------
4242
// Rules
43-
//--------------------------------------------------------------------
43+
// --------------------------------------------------------------------
4444
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require-dev": {
1818
"codeigniter/coding-standard": "^1.1",
1919
"fakerphp/faker": "^1.9",
20-
"friendsofphp/php-cs-fixer": "3.6.*",
20+
"friendsofphp/php-cs-fixer": "~3.11.0",
2121
"mikey179/vfsstream": "^1.6",
2222
"nexusphp/cs-config": "^3.3",
2323
"phpunit/phpunit": "^9.1",

system/API/ResponseTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ protected function fail($messages, int $status = 400, ?string $code = null, stri
136136
return $this->respond($response, $status, $customMessage);
137137
}
138138

139-
//--------------------------------------------------------------------
139+
// --------------------------------------------------------------------
140140
// Response Helpers
141-
//--------------------------------------------------------------------
141+
// --------------------------------------------------------------------
142142

143143
/**
144144
* Used after successfully creating a new resource.
@@ -290,9 +290,9 @@ protected function failServerError(string $description = 'Internal Server Error'
290290
return $this->fail($description, $this->codes['server_error'], $code, $message);
291291
}
292292

293-
//--------------------------------------------------------------------
293+
// --------------------------------------------------------------------
294294
// Utility Methods
295-
//--------------------------------------------------------------------
295+
// --------------------------------------------------------------------
296296

297297
/**
298298
* Handles formatting a response. Currently makes some heavy assumptions

system/CLI/CLI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,9 +756,9 @@ public static function wrap(?string $string = null, int $max = 0, int $padLeft =
756756
return $lines;
757757
}
758758

759-
//--------------------------------------------------------------------
759+
// --------------------------------------------------------------------
760760
// Command-Line 'URI' support
761-
//--------------------------------------------------------------------
761+
// --------------------------------------------------------------------
762762

763763
/**
764764
* Parses the command line it was called from and collects all

system/Cache/Handlers/RedisHandler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,15 @@ public function increment(string $key, int $offset = 1)
200200
{
201201
$key = static::validateKey($key, $this->prefix);
202202

203-
return $this->redis->hIncrBy($key, 'data', $offset);
203+
return $this->redis->hIncrBy($key, '__ci_value', $offset);
204204
}
205205

206206
/**
207207
* {@inheritDoc}
208208
*/
209209
public function decrement(string $key, int $offset = 1)
210210
{
211-
$key = static::validateKey($key, $this->prefix);
212-
213-
return $this->redis->hIncrBy($key, 'data', -$offset);
211+
return $this->increment($key, -$offset);
214212
}
215213

216214
/**

system/CodeIgniter.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CodeIgniter
4747
/**
4848
* The current version of CodeIgniter Framework
4949
*/
50-
public const CI_VERSION = '4.2.5';
50+
public const CI_VERSION = '4.2.6';
5151

5252
/**
5353
* App startup time.
@@ -730,9 +730,12 @@ protected function generateCacheName(Cache $config): string
730730
}
731731

732732
$uri = $this->request->getUri();
733-
734733
if ($config->cacheQueryString) {
735-
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery());
734+
if (is_array($config->cacheQueryString)) {
735+
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery(['only' => $config->cacheQueryString]));
736+
} else {
737+
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery());
738+
}
736739
} else {
737740
$name = URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath());
738741
}
@@ -945,11 +948,9 @@ protected function display404errors(PageNotFoundException $e)
945948
$this->response->setStatusCode($e->getCode());
946949

947950
if (ENVIRONMENT !== 'testing') {
948-
// @codeCoverageIgnoreStart
949951
if (ob_get_level() > 0) {
950-
ob_end_flush();
952+
ob_end_flush(); // @codeCoverageIgnore
951953
}
952-
// @codeCoverageIgnoreEnd
953954
}
954955
// When testing, one is for phpunit, another is for test case.
955956
elseif (ob_get_level() > 2) {

system/Config/BaseService.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -92,43 +92,43 @@
9292
* @see http://blog.ircmaxell.com/2015/11/simple-easy-risk-and-change.html
9393
* @see http://www.infoq.com/presentations/Simple-Made-Easy
9494
*
95-
* @method static CacheInterface cache(Cache $config = null, $getShared = true)
96-
* @method static CLIRequest clirequest(App $config = null, $getShared = true)
97-
* @method static CodeIgniter codeigniter(App $config = null, $getShared = true)
98-
* @method static Commands commands($getShared = true)
99-
* @method static void createRequest(App $config, bool $isCli = false)
100-
* @method static ContentSecurityPolicy csp(CSPConfig $config = null, $getShared = true)
101-
* @method static CURLRequest curlrequest($options = [], ResponseInterface $response = null, App $config = null, $getShared = true)
102-
* @method static Email email($config = null, $getShared = true)
103-
* @method static EncrypterInterface encrypter(Encryption $config = null, $getShared = false)
104-
* @method static Exceptions exceptions(ConfigExceptions $config = null, IncomingRequest $request = null, Response $response = null, $getShared = true)
105-
* @method static Filters filters(ConfigFilters $config = null, $getShared = true)
106-
* @method static Format format(ConfigFormat $config = null, $getShared = true)
107-
* @method static Honeypot honeypot(ConfigHoneyPot $config = null, $getShared = true)
108-
* @method static BaseHandler image($handler = null, Images $config = null, $getShared = true)
109-
* @method static IncomingRequest incomingrequest(?App $config = null, bool $getShared = true)
110-
* @method static Iterator iterator($getShared = true)
111-
* @method static Language language($locale = null, $getShared = true)
112-
* @method static Logger logger($getShared = true)
113-
* @method static MigrationRunner migrations(Migrations $config = null, ConnectionInterface $db = null, $getShared = true)
114-
* @method static Negotiate negotiator(RequestInterface $request = null, $getShared = true)
115-
* @method static Pager pager(ConfigPager $config = null, RendererInterface $view = null, $getShared = true)
116-
* @method static Parser parser($viewPath = null, ConfigView $config = null, $getShared = true)
117-
* @method static RedirectResponse redirectresponse(App $config = null, $getShared = true)
118-
* @method static View renderer($viewPath = null, ConfigView $config = null, $getShared = true)
95+
* @method static CacheInterface cache(Cache $config = null, $getShared = true)
96+
* @method static CLIRequest clirequest(App $config = null, $getShared = true)
97+
* @method static CodeIgniter codeigniter(App $config = null, $getShared = true)
98+
* @method static Commands commands($getShared = true)
99+
* @method static void createRequest(App $config, bool $isCli = false)
100+
* @method static ContentSecurityPolicy csp(CSPConfig $config = null, $getShared = true)
101+
* @method static CURLRequest curlrequest($options = [], ResponseInterface $response = null, App $config = null, $getShared = true)
102+
* @method static Email email($config = null, $getShared = true)
103+
* @method static EncrypterInterface encrypter(Encryption $config = null, $getShared = false)
104+
* @method static Exceptions exceptions(ConfigExceptions $config = null, IncomingRequest $request = null, Response $response = null, $getShared = true)
105+
* @method static Filters filters(ConfigFilters $config = null, $getShared = true)
106+
* @method static Format format(ConfigFormat $config = null, $getShared = true)
107+
* @method static Honeypot honeypot(ConfigHoneyPot $config = null, $getShared = true)
108+
* @method static BaseHandler image($handler = null, Images $config = null, $getShared = true)
109+
* @method static IncomingRequest incomingrequest(?App $config = null, bool $getShared = true)
110+
* @method static Iterator iterator($getShared = true)
111+
* @method static Language language($locale = null, $getShared = true)
112+
* @method static Logger logger($getShared = true)
113+
* @method static MigrationRunner migrations(Migrations $config = null, ConnectionInterface $db = null, $getShared = true)
114+
* @method static Negotiate negotiator(RequestInterface $request = null, $getShared = true)
115+
* @method static Pager pager(ConfigPager $config = null, RendererInterface $view = null, $getShared = true)
116+
* @method static Parser parser($viewPath = null, ConfigView $config = null, $getShared = true)
117+
* @method static RedirectResponse redirectresponse(App $config = null, $getShared = true)
118+
* @method static View renderer($viewPath = null, ConfigView $config = null, $getShared = true)
119119
* @method static IncomingRequest|CLIRequest request(App $config = null, $getShared = true)
120-
* @method static Response response(App $config = null, $getShared = true)
121-
* @method static Router router(RouteCollectionInterface $routes = null, Request $request = null, $getShared = true)
122-
* @method static RouteCollection routes($getShared = true)
123-
* @method static Security security(App $config = null, $getShared = true)
124-
* @method static Session session(App $config = null, $getShared = true)
125-
* @method static Throttler throttler($getShared = true)
126-
* @method static Timer timer($getShared = true)
127-
* @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true)
128-
* @method static Typography typography($getShared = true)
129-
* @method static URI uri($uri = null, $getShared = true)
130-
* @method static Validation validation(ConfigValidation $config = null, $getShared = true)
131-
* @method static Cell viewcell($getShared = true)
120+
* @method static Response response(App $config = null, $getShared = true)
121+
* @method static Router router(RouteCollectionInterface $routes = null, Request $request = null, $getShared = true)
122+
* @method static RouteCollection routes($getShared = true)
123+
* @method static Security security(App $config = null, $getShared = true)
124+
* @method static Session session(App $config = null, $getShared = true)
125+
* @method static Throttler throttler($getShared = true)
126+
* @method static Timer timer($getShared = true)
127+
* @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true)
128+
* @method static Typography typography($getShared = true)
129+
* @method static URI uri($uri = null, $getShared = true)
130+
* @method static Validation validation(ConfigValidation $config = null, $getShared = true)
131+
* @method static Cell viewcell($getShared = true)
132132
*/
133133
class BaseService
134134
{

system/Cookie/CloneableCookieInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ public function withExpired();
6060
* Creates a new Cookie that will virtually never expire from the browser.
6161
*
6262
* @return static
63+
*
64+
* @deprecated See https://github.com/codeigniter4/CodeIgniter4/pull/6413
6365
*/
6466
public function withNeverExpiring();
6567

system/Cookie/Cookie.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ public static function setDefaults($config = [])
152152
return $oldDefaults;
153153
}
154154

155-
//=========================================================================
155+
// =========================================================================
156156
// CONSTRUCTORS
157-
//=========================================================================
157+
// =========================================================================
158158

159159
/**
160160
* Create a new Cookie instance from a `Set-Cookie` header.
@@ -238,9 +238,9 @@ final public function __construct(string $name, string $value = '', array $optio
238238
$this->raw = $raw;
239239
}
240240

241-
//=========================================================================
241+
// =========================================================================
242242
// GETTERS
243-
//=========================================================================
243+
// =========================================================================
244244

245245
/**
246246
* {@inheritDoc}
@@ -391,9 +391,9 @@ public function getOptions(): array
391391
];
392392
}
393393

394-
//=========================================================================
394+
// =========================================================================
395395
// CLONING
396-
//=========================================================================
396+
// =========================================================================
397397

398398
/**
399399
* {@inheritDoc}
@@ -460,7 +460,7 @@ public function withExpired()
460460
}
461461

462462
/**
463-
* {@inheritDoc}
463+
* @deprecated See https://github.com/codeigniter4/CodeIgniter4/pull/6413
464464
*/
465465
public function withNeverExpiring()
466466
{
@@ -556,9 +556,9 @@ public function withRaw(bool $raw = true)
556556
return $cookie;
557557
}
558558

559-
//=========================================================================
559+
// =========================================================================
560560
// ARRAY ACCESS FOR BC
561-
//=========================================================================
561+
// =========================================================================
562562

563563
/**
564564
* Whether an offset exists.
@@ -614,9 +614,9 @@ public function offsetUnset($offset): void
614614
throw new LogicException(sprintf('Cannot unset values of properties of %s as it is immutable.', static::class));
615615
}
616616

617-
//=========================================================================
617+
// =========================================================================
618618
// CONVERTERS
619-
//=========================================================================
619+
// =========================================================================
620620

621621
/**
622622
* {@inheritDoc}
@@ -716,9 +716,9 @@ protected static function convertExpiresTimestamp($expires = 0): int
716716
return $expires > 0 ? (int) $expires : 0;
717717
}
718718

719-
//=========================================================================
719+
// =========================================================================
720720
// VALIDATION
721-
//=========================================================================
721+
// =========================================================================
722722

723723
/**
724724
* Validates the cookie name per RFC 2616.

system/Database/BaseBuilder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,7 @@ public function insert($set = null, ?bool $escape = null)
19281928
* @internal This is a temporary solution.
19291929
*
19301930
* @see https://github.com/codeigniter4/CodeIgniter4/pull/5376
1931+
*
19311932
* @TODO Fix a root cause, and this method should be removed.
19321933
*/
19331934
protected function removeAlias(string $from): string

system/Database/BaseConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,9 +1352,9 @@ protected function getDriverFunctionPrefix(): string
13521352
return strtolower($this->DBDriver) . '_';
13531353
}
13541354

1355-
//--------------------------------------------------------------------
1355+
// --------------------------------------------------------------------
13561356
// META Methods
1357-
//--------------------------------------------------------------------
1357+
// --------------------------------------------------------------------
13581358

13591359
/**
13601360
* Returns an array of table names

system/Database/SQLSRV/Forge.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ protected function _createTableAttributes(array $attributes): string
125125
*/
126126
protected function _alterTable(string $alterType, string $table, $field)
127127
{
128-
129128
// Handle DROP here
130129
if ($alterType === 'DROP') {
131130
// check if fields are part of any indexes

system/Debug/Exceptions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function shutdownHandler()
177177
['type' => $type, 'message' => $message, 'file' => $file, 'line' => $line] = $error;
178178

179179
if (in_array($type, [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE], true)) {
180-
$this->exceptionHandler(new ErrorException($message, $type, 0, $file, $line));
180+
$this->exceptionHandler(new ErrorException($message, 0, $type, $file, $line));
181181
}
182182
}
183183

@@ -329,9 +329,9 @@ protected function determineCodes(Throwable $exception): array
329329
return [$statusCode, $exitStatus];
330330
}
331331

332-
//--------------------------------------------------------------------
332+
// --------------------------------------------------------------------
333333
// Display Methods
334-
//--------------------------------------------------------------------
334+
// --------------------------------------------------------------------
335335

336336
/**
337337
* This makes nicer looking paths for the error output.

0 commit comments

Comments
 (0)