Skip to content

Commit

Permalink
fix(RecipeDb): Remove unnecessary is_array() check
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <kate@provokateurin.de>
  • Loading branch information
provokateurin committed Jan 4, 2025
1 parent b7df5f8 commit 067f974
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion lib/Db/RecipeDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function getRecipesByKeywords(string $keywords, string $user_id) {
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
*/
public function findRecipes(array $keywords, string $user_id) {
$has_keywords = $keywords && is_array($keywords) && $keywords[0];
$has_keywords = $keywords && $keywords[0];

if (!$has_keywords) {
return $this->findAllRecipes($user_id);
Expand Down
6 changes: 0 additions & 6 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
<code><![CDATA['Recipe ' . $id . ' deleted successfully']]></code>
</InvalidArgument>
</file>
<file src="lib/Db/RecipeDb.php">
<RedundantCondition>
<code><![CDATA[$keywords && is_array($keywords)]]></code>
<code><![CDATA[is_array($keywords)]]></code>
</RedundantCondition>
</file>
<file src="lib/Helper/UserFolderHelper.php">
<MissingDependency>
<code><![CDATA[$this->root]]></code>
Expand Down

0 comments on commit 067f974

Please sign in to comment.