summaryrefslogtreecommitdiffstats
path: root/lib/Db
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Db')
-rw-r--r--lib/Db/EntityJSONSerializer.php2
-rw-r--r--lib/Db/Item.php10
-rw-r--r--lib/Db/ItemMapperV2.php4
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/Db/EntityJSONSerializer.php b/lib/Db/EntityJSONSerializer.php
index 2646ed97a..3612d27f1 100644
--- a/lib/Db/EntityJSONSerializer.php
+++ b/lib/Db/EntityJSONSerializer.php
@@ -27,7 +27,7 @@ trait EntityJSONSerializer
{
$result = [];
foreach ($properties as $property) {
- $result[$property] = $this->$property;
+ $result[$property] = $this->$property; //@phpstan-ignore-line
}
return $result;
}
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
*/
diff --git a/lib/Db/ItemMapperV2.php b/lib/Db/ItemMapperV2.php
index 93457d4f9..a8b101719 100644
--- a/lib/Db/ItemMapperV2.php
+++ b/lib/Db/ItemMapperV2.php
@@ -132,12 +132,12 @@ class ItemMapperV2 extends NewsMapperV2
* @param int $feedId ID of the feed
* @param string $guidHash hash to find with
*
- * @return Item|Entity
+ * @return Item
*
* @throws DoesNotExistException
* @throws MultipleObjectsReturnedException
*/
- public function findForUserByGuidHash(string $userId, int $feedId, string $guidHash): Item
+ public function findForUserByGuidHash(string $userId, int $feedId, string $guidHash): Entity
{
$builder = $this->db->getQueryBuilder();
$builder->select('items.*')