Skip to content

Commit

Permalink
Apply sonar cloud feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed May 23, 2024
1 parent 090ed89 commit 6dfd3fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Exception/InvalidFilterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ final class InvalidFilterException extends AbstractApiException
{
public function __construct(string $filter)
{
parent::__construct(400, sprintf(
'Invalid filter: %s',
$filter)
parent::__construct(
400,
sprintf('Invalid filter: %s', $filter)
);
}
}
4 changes: 2 additions & 2 deletions src/Note/Service/FilterService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function applyFilter(NoteListing $list, NoteParameters $parameters): void
{
if ($parameters->getFilter()) {
$list->addConditionParam(
$this->createFilterCondition($parameters->getFilter()),
$this->createFilterCondition(),
['filter' => '%' . $parameters->getFilter() . '%']
);
}
Expand Down Expand Up @@ -103,7 +103,7 @@ private function matchValueOperator(string $operator, mixed $value): mixed
};
}

private function createFilterCondition(string $filter): string
private function createFilterCondition(): string
{
return '('
. '`title` LIKE :filter'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public function __construct()
description: 'Filter for specific fields, will be json decoded to an array.',
in: 'query',
required: false,
example: '[{"operator":"like","value":"John","field":"name","type":"string"}, {"operator":"eq","value":"10","property":"count","type":"numeric"} ]'
example: '[
{"operator":"like","value":"John","field":"name","type":"string"},
{"operator":"eq","value":"10","property":"count","type":"numeric"}
]'
);
}
}

0 comments on commit 6dfd3fc

Please sign in to comment.