Skip to content

Commit fd0d659

Browse files
committed
fix(RecipeDb): Remove unnecessary is_array() check
Signed-off-by: provokateurin <[email protected]>
1 parent 264f44f commit fd0d659

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

lib/Db/RecipeDb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public function getRecipesByKeywords(string $keywords, string $user_id) {
349349
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
350350
*/
351351
public function findRecipes(array $keywords, string $user_id) {
352-
$has_keywords = $keywords && is_array($keywords) && $keywords[0];
352+
$has_keywords = $keywords && $keywords[0];
353353

354354
if (!$has_keywords) {
355355
return $this->findAllRecipes($user_id);

tests/psalm-baseline.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
<code><![CDATA['Recipe ' . $id . ' deleted successfully']]></code>
2727
</InvalidArgument>
2828
</file>
29-
<file src="lib/Db/RecipeDb.php">
30-
<RedundantCondition>
31-
<code><![CDATA[$keywords && is_array($keywords)]]></code>
32-
<code><![CDATA[is_array($keywords)]]></code>
33-
</RedundantCondition>
34-
</file>
3529
<file src="lib/Helper/UserFolderHelper.php">
3630
<MissingDependency>
3731
<code><![CDATA[$this->root]]></code>

0 commit comments

Comments
 (0)