diff options
| author | 2023-03-31 08:23:39 +0200 | |
|---|---|---|
| committer | 2023-03-31 08:23:39 +0200 | |
| commit | 288ed04ccc30b58373576dc3be811aee43e67034 (patch) | |
| tree | 27f4c571e04d64c97737416dfa2b8d65f481dfd8 /app/Models/UserDAO.php | |
| parent | c9d5fe2da12cbc3a071ebf9a518afe2789bb3d61 (diff) | |
PHPStan level 6 for all PDO and Exception classes (#5239)
* PHPStan level 6 for all PDO and Exception classes
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
* Fix type
* Now also our remaining own librairies
* Motivation for a few more files
* A few more DAO classes
* Last interface
Diffstat (limited to 'app/Models/UserDAO.php')
| -rw-r--r-- | app/Models/UserDAO.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php index 9f91df80e..8ba50cc29 100644 --- a/app/Models/UserDAO.php +++ b/app/Models/UserDAO.php @@ -1,7 +1,8 @@ <?php class FreshRSS_UserDAO extends Minz_ModelPdo { - public function createUser() { + + public function createUser(): bool { require(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php'); try { @@ -21,7 +22,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { } } - public function deleteUser() { + public function deleteUser(): bool { if (defined('STDERR')) { fwrite(STDERR, 'Deleting SQL data for user “' . $this->current_user . "”…\n"); } @@ -38,18 +39,18 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { } } - public static function exists($username) { + public static function exists(string $username): bool { return is_dir(USERS_PATH . '/' . $username); } - public static function touch($username = '') { + public static function touch(string $username = ''): bool { if (!FreshRSS_user_Controller::checkUsername($username)) { $username = Minz_User::name() ?? Minz_User::INTERNAL_USER; } return touch(USERS_PATH . '/' . $username . '/config.php'); } - public static function mtime($username) { - return @filemtime(USERS_PATH . '/' . $username . '/config.php'); + public static function mtime(string $username): int { + return @(int)filemtime(USERS_PATH . '/' . $username . '/config.php'); } } |
