Refacto all project #1

Merged
Xefir merged 18 commits from test into master 2023-06-17 23:48:37 +00:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 1d7c8a028d - Show all commits

View File

@ -25,10 +25,10 @@ abstract class ReaderMapper extends QBMapper {
/** /**
* @param IDBConnection $db Instance of the Db abstraction layer * @param IDBConnection $db Instance of the Db abstraction layer
* @param string $table the name of the table. set this to allow entity * @param string $table the name of the table. set this to allow entity
* @param class-string<ReaderEntity>|null $entity the name of the entity that the sql should be mapped to queries without using sql * @param class-string<ReaderEntity> $entity the name of the entity that the sql should be mapped to queries without using sql
* @param Time $time * @param Time $time
*/ */
public function __construct(IDBConnection $db, string $table, ?string $entity = null, Time $time) { public function __construct(IDBConnection $db, string $table, string $entity, Time $time) {
parent::__construct($db, $table, $entity); parent::__construct($db, $table, $entity);
$this->time = $time; $this->time = $time;
} }

View File

@ -39,7 +39,7 @@ class Hooks {
} }
} }
protected function deleteFile(IDBConnection $connection, int $fileId): void { protected static function deleteFile(IDBConnection $connection, int $fileId): void {
$queryBuilder = $connection->getQueryBuilder(); $queryBuilder = $connection->getQueryBuilder();
$queryBuilder->delete('reader_bookmarks')->where('file_id = file_id')->setParameter('file_id', $fileId); $queryBuilder->delete('reader_bookmarks')->where('file_id = file_id')->setParameter('file_id', $fileId);
$queryBuilder->executeStatement(); $queryBuilder->executeStatement();
@ -49,7 +49,7 @@ class Hooks {
$queryBuilder->executeStatement(); $queryBuilder->executeStatement();
} }
protected function deleteUser(IDBConnection $connection, string $userId): void { protected static function deleteUser(IDBConnection $connection, string $userId): void {
$queryBuilder = $connection->getQueryBuilder(); $queryBuilder = $connection->getQueryBuilder();
$queryBuilder->delete('reader_bookmarks')->where('user_id = user_id')->setParameter('user_id', $userId); $queryBuilder->delete('reader_bookmarks')->where('user_id = user_id')->setParameter('user_id', $userId);
$queryBuilder->executeStatement(); $queryBuilder->executeStatement();