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 12, 2025
1 parent 144e0af commit 4b71690
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
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<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 4b71690

Please sign in to comment.