Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Use class name instead of self #106

Merged
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
4 changes: 2 additions & 2 deletions src/HybridSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ public static function init(string $key = null)

session_set_save_handler($instance, true);

self::$enabled = true;
HybridSession::$enabled = true;
}

public static function is_enabled(): bool
{
return self::$enabled;
return HybridSession::$enabled;
}
}
8 changes: 4 additions & 4 deletions src/Store/DatabaseStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function gc(int $maxlifetime): int|false
public static function binaryDataJsonEncode(string $data): string
{
return json_encode([
self::class,
DatabaseStore::class,
base64_encode($data ?? '')
]);
}
Expand All @@ -156,7 +156,7 @@ public static function binaryDataJsonDecode(string $text): ?string
return null;
}

if (!isset($struct[0]) || !isset($struct[1]) || $struct[0] !== self::class) {
if (!isset($struct[0]) || !isset($struct[1]) || $struct[0] !== DatabaseStore::class) {
return null;
}

Expand All @@ -166,8 +166,8 @@ public static function binaryDataJsonDecode(string $text): ?string
private function encryptSessionID(string $sessionID): string
{
if (is_null($this->hashAlgoAvailable)) {
$this->hashAlgoAvailable = in_array(self::HASH_ALGO, hash_algos());
$this->hashAlgoAvailable = in_array(DatabaseStore::HASH_ALGO, hash_algos());
}
return $this->hashAlgoAvailable ? hash(self::HASH_ALGO, $sessionID) : $sessionID;
return $this->hashAlgoAvailable ? hash(DatabaseStore::HASH_ALGO, $sessionID) : $sessionID;
}
}
4 changes: 2 additions & 2 deletions tests/Store/TestCookieStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class TestCookieStore extends CookieStore implements TestOnly

protected function canWrite(): bool
{
if (self::$override_headers_sent !== null) {
return !self::$override_headers_sent;
if (TestCookieStore::$override_headers_sent !== null) {
return !TestCookieStore::$override_headers_sent;
}

parent::canWrite();
Expand Down
Loading