Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/Session/Handlers/ArrayHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function destroy($id): bool
* @param int $max_lifetime Sessions that have not updated
* for the last max_lifetime seconds will be removed.
*/
public function gc($max_lifetime): int
public function gc(int $max_lifetime): int
{
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion system/Session/Handlers/Database/PostgreHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function prepareData(string $data): string
* @param int $max_lifetime Sessions that have not updated
* for the last max_lifetime seconds will be removed.
*/
public function gc($max_lifetime): false|int
public function gc(int $max_lifetime): false|int
{
$separator = '\'';
$interval = implode($separator, ['', "{$max_lifetime} second", '']);
Expand Down
2 changes: 1 addition & 1 deletion system/Session/Handlers/DatabaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function destroy($id): bool
*
* @return false|int Returns the number of deleted sessions on success, or false on failure.
*/
public function gc($max_lifetime): false|int
public function gc(int $max_lifetime): false|int
{
return $this->db->table($this->table)->where(
'timestamp <',
Expand Down
2 changes: 1 addition & 1 deletion system/Session/Handlers/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public function destroy($id): bool
* @param int $max_lifetime Sessions that have not updated
* for the last max_lifetime seconds will be removed.
*/
public function gc($max_lifetime): false|int
public function gc(int $max_lifetime): false|int
{
if (! is_dir($this->savePath) || ($directory = opendir($this->savePath)) === false) {
$this->logger->debug("Session: Garbage collector couldn't list files under directory '" . $this->savePath . "'.");
Expand Down
2 changes: 1 addition & 1 deletion system/Session/Handlers/MemcachedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function destroy($id): bool
* @param int $max_lifetime Sessions that have not updated
* for the last max_lifetime seconds will be removed.
*/
public function gc($max_lifetime): int
public function gc(int $max_lifetime): int
{
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion system/Session/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function destroy($id): bool
* @param int $max_lifetime Sessions that have not updated
* for the last max_lifetime seconds will be removed.
*/
public function gc($max_lifetime): int
public function gc(int $max_lifetime): int
{
return 1;
}
Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelogs/v4.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Method Signature Changes
- **Database:** The following methods have had their signatures updated to remove deprecated parameters:
- ``CodeIgniter\Database\Forge::_createTable()`` no longer accepts the deprecated ``$ifNotExists`` parameter. The method signature is now ``_createTable(string $table, array $attributes)``.
- **Model:** ``CodeIgniter\BaseModel`` now requires the ``chunkRows()``, ``chunkById()``, and ``chunkRowsById()`` methods. Custom classes extending ``BaseModel`` directly must implement them.
- **Session:** The ``$max_lifetime`` parameter of the following ``gc()`` methods now has the native ``int`` type, matching ``SessionHandlerInterface``: ``ArrayHandler::gc()``, ``DatabaseHandler::gc()``, ``FileHandler::gc()``, ``MemcachedHandler::gc()``, ``PostgreHandler::gc()``, ``RedisHandler::gc()``.

Property Scope Changes
======================
Expand Down