Skip to content

Commit

Permalink
chore: add missing return type
Browse files Browse the repository at this point in the history
Add missing methods return type in UserTable class.

Remove unused use statement.
  • Loading branch information
dfranco committed Jan 14, 2024
1 parent d86df1c commit 11656ef
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions application/Table/UserTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
namespace App\Table;

use App\Entity\User;
use Core\App\CErrorHandler;
use Core\Db\Table;
use PDOStatement;

Expand All @@ -34,7 +33,7 @@ class UserTable extends Table
* @param $username
* @return mixed
*/
public function findByName($username)
public function findByName($username): mixed
{
$sqlQuery = "SELECT * FROM 'Users' WHERE username = :username";

Expand All @@ -49,7 +48,7 @@ public function findByName($username)
/**
* @return mixed
*/
public function getAll()
public function getAll(): mixed
{
$getUsersQuery = "SELECT username,email FROM Users";

Expand All @@ -59,9 +58,9 @@ public function getAll()
/**
* @param string $username
* @param string $password
* @return PDOStatement|bool
* @return bool|PDOStatement
*/
public function setPassword(string $username, string $password)
public function setPassword(string $username, string $password): bool|PDOStatement
{
$user = $this->findByName($username);

Expand All @@ -81,9 +80,9 @@ public function setPassword(string $username, string $password)
* @param $username
* @param $email
* @param $password
* @return bool|int
* @return bool|PDOStatement
*/
public function addUser($username, $email, $password)
public function addUser($username, $email, $password): bool|PDOStatement
{
$user = new User();

Expand All @@ -103,9 +102,9 @@ public function addUser($username, $email, $password)
}

/**
* @return false|int
* @return bool|int
*/
public function createSchema()
public function createSchema(): bool|int
{
$createSchemaQuery = 'CREATE TABLE IF NOT EXISTS Users (
user_id INTEGER PRIMARY KEY,
Expand Down

0 comments on commit 11656ef

Please sign in to comment.