for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Bluz Framework Component
*
* @copyright Bluz PHP Team
* @link https://github.com/bluzphp/framework
*/
declare(strict_types=1);
namespace Bluz\Session\Adapter;
* Abstract session handler
* @package Bluz\Session\Adapter
abstract class AbstractAdapter
{
* @var mixed instance of Redis or Cache or some other
protected $handler = null;
* @var string prefix for session store
protected $prefix = 'PHPSESSID:';
* @var integer TTL of session
protected $ttl = 1800;
* Prepare Id - add prefix
* @param string $id
* @return string
protected function prepareId($id): string
return $this->prefix . $id;
}
* Initialize session
* @param string $savePath
* @param string $sessionName
* @return bool
public function open($savePath, $sessionName): bool
$savePath
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function open(/** @scrutinizer ignore-unused */ $savePath, $sessionName): bool
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$this->prefix = $sessionName . ':';
$this->ttl = (int)ini_get('session.gc_maxlifetime');
// No more action necessary because connection is injected
// in constructor and arguments are not applicable.
return true;
* Close the session
public function close(): bool
$this->handler = null;
unset($this->handler);
* Cleanup old sessions
* @param integer $maxLifetime
public function gc($maxLifetime): bool
$maxLifetime
public function gc(/** @scrutinizer ignore-unused */ $maxLifetime): bool
// no action necessary because using EXPIRE
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.