Fixed phpstan detections.

This commit is contained in:
flash 2023-07-27 23:49:55 +00:00
parent 461ffbf73b
commit 20b309563e
4 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,7 @@
<?php <?php
namespace Misuzu\Auth; namespace Misuzu\Auth;
use Index\TimeSpan;
use Index\Data\DbStatementCache; use Index\Data\DbStatementCache;
use Index\Data\IDbConnection; use Index\Data\IDbConnection;
use Index\Net\IPAddress; use Index\Net\IPAddress;

View file

@ -44,7 +44,7 @@ class RecoveryTokenInfo {
return $this->created + self::LIFETIME; return $this->created + self::LIFETIME;
} }
public function getExpiresAt(): bool { public function getExpiresAt(): DateTime {
return DateTime::fromUnixTimeSeconds($this->created + self::LIFETIME); return DateTime::fromUnixTimeSeconds($this->created + self::LIFETIME);
} }

View file

@ -37,7 +37,7 @@ class Roles {
$query .= ' WHERE role_id IN (SELECT role_id FROM msz_users_roles WHERE user_id = ?)'; $query .= ' WHERE role_id IN (SELECT role_id FROM msz_users_roles WHERE user_id = ?)';
} }
if($hasHidden) if($hasHidden)
$query .= sprintf(' %s role_hidden %s 0', ++$args > 0 ? 'AND' : 'WHERE', $hidden ? '=' : '<>'); $query .= sprintf(' %s role_hidden %s 0', ++$args > 1 ? 'AND' : 'WHERE', $hidden ? '=' : '<>');
$args = 0; $args = 0;
$stmt = $this->cache->get($query); $stmt = $this->cache->get($query);

View file

@ -7,11 +7,11 @@ use Index\Data\DbTools;
use Index\Data\IDbConnection; use Index\Data\IDbConnection;
class Users { class Users {
private IDbConnection $dbConn; //private IDbConnection $dbConn;
private DbStatementCache $cache; private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) { public function __construct(IDbConnection $dbConn) {
$this->dbConn = $dbConn; //$this->dbConn = $dbConn;
$this->cache = new DbStatementCache($dbConn); $this->cache = new DbStatementCache($dbConn);
} }