Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Aug 21, 2023
1 parent 54ea9f6 commit 1f33a6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,7 @@ public function getDocument(string $collection, string $id, array $queries = [])
$collection = $this->silent(fn () => $this->getCollection($collection));

if ($collection->isEmpty()) {
throw new DatabaseException("Collection not found");
throw new DatabaseException('Collection not found');
}

$attributes = $collection->getAttribute('attributes', []);
Expand Down Expand Up @@ -4243,7 +4243,6 @@ public function count(string $collection, array $queries = [], ?int $max = null)
$queries = Query::groupByType($queries)['filters'];
$queries = self::convertQueries($collection, $queries);


$getCount = fn () => $this->adapter->count($collection->getId(), $queries, $max);
$count = $skipAuth ?? false ? Authorization::skip($getCount) : $getCount();

Expand Down
4 changes: 2 additions & 2 deletions src/Database/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public static function parse(string $filter): self
$paramsStart = mb_strpos($filter, static::CHAR_PARENTHESES_START);

if ($paramsStart === false) {
throw new QueryException("Invalid query");
throw new QueryException('Invalid query');
}

$method = mb_substr($filter, 0, $paramsStart);
Expand All @@ -211,7 +211,7 @@ public static function parse(string $filter): self

// Check for deprecated query syntax
if (\str_contains($method, '.')) {
throw new QueryException("Invalid query method");
throw new QueryException('Invalid query method');
}

$currentParam = ""; // We build param here before pushing when it's ended
Expand Down

0 comments on commit 1f33a6e

Please sign in to comment.