mikecbrant/php-ultimate-sessions

View on GitHub
src/UltimateSessions/UltimateSessionHandlerTrait.php

Summary

Maintainability
A
35 mins
Test Coverage
A
100%

Showing 5 of 15 total issues

setEncryptionKeyCookie accesses the super-global variable $_COOKIE.
Wontfix

public function setEncryptionKeyCookie($sessionId, $asciiKey)
{
$this->validateSessionId($sessionId);
if(empty($asciiKey) || !is_string($asciiKey)) {
throw new \InvalidArgumentException(

deleteEncryptionKeyCookie accesses the super-global variable $_COOKIE.
Wontfix

public function deleteEncryptionKeyCookie($sessionId)
{
$this->validateSessionId($sessionId);
$cookieName = $this->config->keyCookiePrefix . $sessionId;
setcookie(

changeKeyCookieSessionId accesses the super-global variable $_COOKIE.
Wontfix

public function changeKeyCookieSessionId($oldSessionId, $newSessionId)
{
$this->validateSessionId($oldSessionId);
$this->validateSessionId($newSessionId);
$oldCookieName = $this->config->keyCookiePrefix . $oldSessionId;

setEncryptionKey accesses the super-global variable $_COOKIE.
Wontfix

public function setEncryptionKey($sessionId)
{
$cookieName = $this->config->keyCookiePrefix . $sessionId;
if(!empty($_COOKIE[$cookieName])) {
$this->encryptionKey = Key::loadFromAsciiSafeString($_COOKIE[$cookieName]);

changeKeyCookieSessionId accesses the super-global variable $_COOKIE.
Wontfix

public function changeKeyCookieSessionId($oldSessionId, $newSessionId)
{
$this->validateSessionId($oldSessionId);
$this->validateSessionId($newSessionId);
$oldCookieName = $this->config->keyCookiePrefix . $oldSessionId;

setEncryptionKey accesses the super-global variable $_COOKIE.
Wontfix

public function setEncryptionKey($sessionId)
{
$cookieName = $this->config->keyCookiePrefix . $sessionId;
if(!empty($_COOKIE[$cookieName])) {
$this->encryptionKey = Key::loadFromAsciiSafeString($_COOKIE[$cookieName]);

Function configureIniSettings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

private function configureIniSettings()
{
/**
* Ignore these lines from code coverage as they are covered in build
* tests against different PHP versions.
Severity: Minor
Found in src/UltimateSessions/UltimateSessionHandlerTrait.php - About 35 mins to fix

Missing class import via use statement (line '59', column '23').
Open

throw new \Exception(

Missing class import via use statement (line '282', column '27').
Open

throw new \RuntimeException(

Missing class import via use statement (line '85', column '23').
Open

throw new \InvalidArgumentException('Value did not match session ID regex.');

Missing class import via use statement (line '103', column '23').
Open

throw new \InvalidArgumentException(

Avoid using static access to class '\Defuse\Crypto\Crypto' in method 'encrypt'.
Wontfix

return Crypto::encrypt($sessionData, $key);

Avoid using static access to class '\Defuse\Crypto\Key' in method 'setEncryptionKey'.
Wontfix

$this->encryptionKey = Key::loadFromAsciiSafeString($_COOKIE[$cookieName]);

Avoid using static access to class '\Defuse\Crypto\Key' in method 'setEncryptionKey'.
Wontfix

$this->encryptionKey = Key::createNewRandomKey();

Avoid using static access to class '\Defuse\Crypto\Crypto' in method 'decrypt'.
Wontfix

return Crypto::decrypt($sessionData, $key);

There are no issues that match your filters.

Category
Status