From 288ed04ccc30b58373576dc3be811aee43e67034 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 31 Mar 2023 08:23:39 +0200 Subject: 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 --- app/Models/ReadingMode.php | 55 +++++++++++----------------------------------- 1 file changed, 13 insertions(+), 42 deletions(-) (limited to 'app/Models/ReadingMode.php') diff --git a/app/Models/ReadingMode.php b/app/Models/ReadingMode.php index ddb413315..6f2fc889c 100644 --- a/app/Models/ReadingMode.php +++ b/app/Models/ReadingMode.php @@ -28,12 +28,9 @@ class FreshRSS_ReadingMode { /** * ReadingMode constructor. - * @param string $id - * @param string $title - * @param string[] $urlParams - * @param bool $active + * @param array $urlParams */ - public function __construct($id, $title, $urlParams, $active) { + public function __construct(string $id, string $title, array $urlParams, bool $active) { $this->id = $id; $this->name = _i($id); $this->title = $title; @@ -41,41 +38,24 @@ class FreshRSS_ReadingMode { $this->isActive = $active; } - /** - * @return string - */ - public function getId() { + public function getId(): string { return $this->id; } - /** - * @return string - */ - public function getName() { + public function getName(): string { return $this->name; } - /** - * @param string $name - * @return FreshRSS_ReadingMode - */ - public function setName($name) { + public function setName(string $name): FreshRSS_ReadingMode { $this->name = $name; return $this; } - /** - * @return string - */ - public function getTitle() { + public function getTitle(): string { return $this->title; } - /** - * @param string $title - * @return FreshRSS_ReadingMode - */ - public function setTitle($title) { + public function setTitle(string $title): FreshRSS_ReadingMode { $this->title = $title; return $this; } @@ -83,40 +63,31 @@ class FreshRSS_ReadingMode { /** * @return array */ - public function getUrlParams() { + public function getUrlParams(): array { return $this->urlParams; } /** * @param array $urlParams - * @return FreshRSS_ReadingMode */ - public function setUrlParams($urlParams) { + public function setUrlParams(array $urlParams): FreshRSS_ReadingMode { $this->urlParams = $urlParams; return $this; } - /** - * @return bool - */ - public function isActive() { + public function isActive(): bool { return $this->isActive; } - /** - * @param bool $isActive - * @return FreshRSS_ReadingMode - */ - public function setIsActive($isActive) { + public function setIsActive(bool $isActive): FreshRSS_ReadingMode { $this->isActive = $isActive; return $this; } /** - * Returns the built-in reading modes. - * return ReadingMode[] + * @return array the built-in reading modes */ - public static function getReadingModes() { + public static function getReadingModes(): array { $actualView = Minz_Request::actionName(); $defaultCtrl = Minz_Request::defaultControllerName(); $isDefaultCtrl = Minz_Request::controllerName() === $defaultCtrl; -- cgit v1.2.3