Skip to content

Commit 583dbe2

Browse files
committed
fix: phpstan errors in src
1 parent b84d548 commit 583dbe2

5 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/Linna/Authentication/ProtectedControllerTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
* <p>This trait contains only private mothods.</p>
2424
*/
25-
trait ProtectedControllerTrait
25+
trait ProtectedControllerTrait // @phpstan-ignore trait.unused
2626
{
2727
/** @var bool Contain login status. */
2828
private bool $authentication = false;

src/Linna/Autoloader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function register(): bool
8888
$callback = '\Linna\Autoloader::loadClass';
8989
$result = false;
9090

91+
/** @phpstan-ignore-next-line */
9192
if (\is_callable($callback)) {
9293
/** @phpstan-ignore-next-line */
9394
$result = $result || \spl_autoload_register($callback);

src/Linna/Cache/RedisCache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function __construct(array $options)
4040
$this->redis = new Redis();
4141
$callback = [$this->redis, 'connect'];
4242

43+
/** @phpstan-ignore-next-line */
4344
if (!isset($options['connect']['host']) || \is_callable($callback) && !\call_user_func_array($callback, $options['connect'])) {
4445
throw new InvalidArgumentException('Unable to connect to Redis server.');
4546
}

src/Linna/Session/EncryptedSessionHandler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ public function read(string $id): string|false
134134
//get encrypted session data
135135
$ciphertext = $this->handler->read($id);
136136

137+
if ($ciphertext === false) {
138+
return "";
139+
}
140+
137141
//if session doesn't contain data, return a void string
138142
if (\strlen($ciphertext) === 0) {
139143
return "";

src/Linna/Storage/ExtendedPDO.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function queryWithParam(string $query, array $params): PDOStatement|false
3939

4040
$callback = [$statement, "bindParam"];
4141

42+
/** @phpstan-ignore-next-line */
4243
if (\is_callable($callback)) {
4344
foreach ($params as $value) {
4445
$this->checkValue($value);

0 commit comments

Comments
 (0)