Skip to content

Commit 4cbe055

Browse files
committed
Empty is not valid
1 parent b9de83c commit 4cbe055

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Database/Validator/Query/Order.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ public function isValid($value): bool
5757
$attribute = $value->getAttribute();
5858

5959
if ($method === Query::TYPE_ORDER_ASC || $method === Query::TYPE_ORDER_DESC) {
60-
if ($attribute === '') {
61-
return true;
62-
}
6360
return $this->isValidAttribute($attribute);
6461
}
6562

tests/unit/Validator/Query/OrderTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public function setUp(): void
2727
'type' => Database::VAR_STRING,
2828
'array' => false,
2929
]),
30+
new Document([
31+
'$id' => '$internalId',
32+
'key' => '$internalId',
33+
'type' => Database::VAR_STRING,
34+
'array' => false,
35+
]),
3036
],
3137
);
3238
}

0 commit comments

Comments
 (0)