diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-11-20 20:52:54 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-03-25 18:47:38 +0100 |
commit | 2baa7a2b9136d4d4dc1e56dfc043cc71da3ee1df (patch) | |
tree | d8f970ce85442869ad9547f80f70153a31820563 /lib/Db/Item.php | |
parent | 8b519cd234b1293e03ef288617287be1a30cfc75 (diff) |
Make PHPstan stricter
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Db/Item.php')
-rw-r--r-- | lib/Db/Item.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Db/Item.php b/lib/Db/Item.php index 97b3bc1ca..2d87babf7 100644 --- a/lib/Db/Item.php +++ b/lib/Db/Item.php @@ -126,7 +126,7 @@ class Item extends Entity implements IAPI, \JsonSerializable public function generateSearchIndex(): void { - $categoriesString = !empty($this->getCategories()) + $categoriesString = !is_null($this->getCategories()) ? implode('', $this->getCategories()) : ''; @@ -542,7 +542,7 @@ class Item extends Entity implements IAPI, \JsonSerializable public function setCategories(array $categories = null): self { - $categoriesJson = !empty($categories) ? json_encode($categories) : null; + $categoriesJson = !is_null($categories) ? json_encode($categories) : null; $this->setCategoriesJson($categoriesJson); return $this; @@ -577,11 +577,11 @@ class Item extends Entity implements IAPI, \JsonSerializable /** * Format for exporting. * - * @param $feeds + * @param array $feeds List of feeds * * @return array */ - public function toExport($feeds): array + public function toExport(array $feeds): array { return [ 'guid' => $this->getGuid(), @@ -622,7 +622,7 @@ class Item extends Entity implements IAPI, \JsonSerializable /** * Check if a given mimetype is supported * - * @param string $mime mimetype to check + * @param string|null $mime mimetype to check * * @return boolean */ |