Skip to content

Commit 4b71690

Browse files
committed
fix(RecipeDb): Remove unnecessary is_array() check
Signed-off-by: provokateurin <[email protected]>
1 parent 144e0af commit 4b71690

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
@@ -1,11 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
3-
<file src="lib/Db/RecipeDb.php">
4-
<RedundantCondition>
5-
<code><![CDATA[$keywords && is_array($keywords)]]></code>
6-
<code><![CDATA[is_array($keywords)]]></code>
7-
</RedundantCondition>
8-
</file>
93
<file src="lib/Helper/UserFolderHelper.php">
104
<MissingDependency>
115
<code><![CDATA[$this->root]]></code>

0 commit comments

Comments
 (0)