Skip to content

Commit 7bcc8ad

Browse files
committed
fixing tests
1 parent 9db24f2 commit 7bcc8ad

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Constraint/Type.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class Type implements Constraint
1212
const BOOLEAN = 'boolean';
1313
const NULL = 'null';
1414

15-
public $types;
16-
1715
public static function isValid($types, $data)
1816
{
1917
if (!is_array($types)) {

src/Schema.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,11 @@ private function process($data, $import = true, DataPreProcessor $preProcessor =
128128
}
129129

130130
if ($this->type !== null) {
131-
if (!$this->type->isValid($data)) {
132-
$this->fail(new TypeException(ucfirst(implode(', ', $this->type->types) . ' expected, ' . json_encode($data) . ' received')), $path);
131+
if (!Type::isValid($this->type, $data)) {
132+
$this->fail(new TypeException(ucfirst(
133+
implode(', ', is_array($this->type) ? $this->type : array($this->type))
134+
. ' expected, ' . json_encode($data) . ' received')
135+
), $path);
133136
}
134137
}
135138

0 commit comments

Comments
 (0)