Skip to content

Commit

Permalink
Merge pull request #106 from creative-commoners/pulls/3.0/remove-self
Browse files Browse the repository at this point in the history
ENH Use class name instead of self
  • Loading branch information
GuySartorelli authored Jun 17, 2024
2 parents de4492d + 70b760d commit bad70d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit bad70d3

Please sign in to comment.