diff --git a/src/Checker.php b/src/Checker.php index 6183985..88b3f3d 100644 --- a/src/Checker.php +++ b/src/Checker.php @@ -14,9 +14,9 @@ class Checker implements CheckerInterface /** * @inheritdoc */ - public function fulfills($argument1, TypeInterface $requirement) + public function fulfills($element, TypeInterface $requirement) { - return new Result(true, []); + return $requirement->check($element); } } \ No newline at end of file diff --git a/src/Type/ListType.php b/src/Type/ListType.php index 1b385ab..cf1364e 100644 --- a/src/Type/ListType.php +++ b/src/Type/ListType.php @@ -45,7 +45,7 @@ public function check($value) foreach ($value as $item) { $result = $this->child->check($item); - $valid &= $result->isValid(); + $valid = $valid && $result->isValid(); $errors += $result->getErrors(); } diff --git a/src/Type/ObjectType.php b/src/Type/ObjectType.php index d67b5a9..ae32168 100644 --- a/src/Type/ObjectType.php +++ b/src/Type/ObjectType.php @@ -40,7 +40,7 @@ public function check($value) } $result = $child->check($value[$key]); - $valid &= $result->isValid(); + $valid = $valid && $result->isValid(); $errors += $result->getErrors(); }