Skip to content

Commit a29e59d

Browse files
committed
address comment.
1 parent 57545de commit a29e59d

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/App.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
use Utopia\Telemetry\Adapter\None as NoTelemetry;
77
use Utopia\Telemetry\Histogram;
88
use Utopia\Telemetry\UpDownCounter;
9+
use Utopia\Validator\ArrayList;
10+
use Utopia\Validator\Boolean;
11+
use Utopia\Validator\FloatValidator;
12+
use Utopia\Validator\Integer;
13+
use Utopia\Validator\Text;
914

1015
class App
1116
{
@@ -718,7 +723,7 @@ protected function getArguments(Hook $hook, array $values, array $requestParams)
718723
}
719724
if (\is_array($value)) {
720725
$validator = $param['validator'];
721-
$isArrayList = $validator instanceof \Utopia\Validator\ArrayList;
726+
$isArrayList = $validator instanceof ArrayList;
722727

723728
if ($isArrayList) {
724729
try {
@@ -750,20 +755,20 @@ protected function getArguments(Hook $hook, array $values, array $requestParams)
750755
$validator = $this->validate($key, $param, $value);
751756

752757
if ($existsInRequest && $value !== null) {
753-
if ($validator instanceof \Utopia\Validator\Boolean) {
758+
if ($validator instanceof Boolean) {
754759
$value = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
755760
if ($value === null) {
756761
throw new Exception('Invalid boolean value for param "' . $key . '"', 400);
757762
}
758-
} elseif ($validator instanceof \Utopia\Validator\Integer && \is_string($value)) {
763+
} elseif ($validator instanceof Integer && \is_string($value)) {
759764
if (\is_numeric($value)) {
760765
$value = (int)$value;
761766
}
762-
} elseif ($validator instanceof \Utopia\Validator\FloatValidator && \is_string($value)) {
767+
} elseif ($validator instanceof FloatValidator && \is_string($value)) {
763768
if (\is_numeric($value)) {
764769
$value = (float)$value;
765770
}
766-
} elseif ($validator instanceof \Utopia\Validator\Text && !\is_string($value)) {
771+
} elseif ($validator instanceof Text && !\is_string($value)) {
767772
$value = (string)$value;
768773
}
769774
}

0 commit comments

Comments
 (0)