Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(RecipeDb): Remove unnecessary is_array() check
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin authored and christianlupus committed Mar 5, 2025
commit b3af7b14493020402eb32b922d5d1de17bdbe2a1
2 changes: 1 addition & 1 deletion lib/Db/RecipeDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
* @deprecated
* @todo Why deprecated?

Check warning on line 36 in lib/Db/RecipeDb.php

View workflow job for this annotation

GitHub Actions / Check for added todo messages

Found @todo Why deprecated?
*/
public function findRecipeById(int $id) {
$qb = $this->db->getQueryBuilder();
Expand Down Expand Up @@ -349,7 +349,7 @@
* @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
Loading