Skip to content

Commit 905c561

Browse files
committed
chore: use [] checks instead of count with zero on array
1 parent 6526337 commit 905c561

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Toolbox/Tool/SimilaritySearch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __invoke(string $searchTerm): string
4545
$vectors = $this->platform->request($this->model, $searchTerm)->getContent();
4646
$this->usedDocuments = $this->vectorStore->query($vectors[0]);
4747

48-
if (0 === \count($this->usedDocuments)) {
48+
if ([] === $this->usedDocuments) {
4949
return 'No results found';
5050
}
5151

src/Toolbox/Tool/Wikipedia.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function search(string $query): string
4141

4242
$titles = array_map(fn (array $item) => $item['title'], $result['query']['search']);
4343

44-
if (0 === \count($titles)) {
44+
if ([] === $titles) {
4545
return 'No articles were found on Wikipedia.';
4646
}
4747

src/Toolbox/ToolFactory/ReflectionToolFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getTool(string $reference): iterable
3333
$reflectionClass = new \ReflectionClass($reference);
3434
$attributes = $reflectionClass->getAttributes(AsTool::class);
3535

36-
if (0 === \count($attributes)) {
36+
if ([] === $attributes) {
3737
throw ToolException::missingAttribute($reference);
3838
}
3939

0 commit comments

Comments
 (0)