aboutsummaryrefslogtreecommitdiff
path: root/app/Models/ReadingMode.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-03-31 08:23:39 +0200
committerGravatar GitHub <noreply@github.com> 2023-03-31 08:23:39 +0200
commit288ed04ccc30b58373576dc3be811aee43e67034 (patch)
tree27f4c571e04d64c97737416dfa2b8d65f481dfd8 /app/Models/ReadingMode.php
parentc9d5fe2da12cbc3a071ebf9a518afe2789bb3d61 (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/ReadingMode.php')
-rw-r--r--app/Models/ReadingMode.php55
1 files changed, 13 insertions, 42 deletions
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<string> $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<string>
*/
- public function getUrlParams() {
+ public function getUrlParams(): array {
return $this->urlParams;
}
/**
* @param array<string> $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<FreshRSS_ReadingMode> 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;