<?php
// this sample has an error caused by a wrong interface
include_once 'InputValidator.php';
interface testInterface {}
class Alpha implements testInterface{}
class Beta{}
$definition = array(
"data" => array(
"is_active" => false,
"name" => "Thomas",
"firstname" => "Schaefer",
"born_at" => "2012-05-23",
"gender" => 1,
"address" => array(
"city" => "Erftstadt",
"zip" => 50374
),
"myObject" => new Alpha
)
);
$data = array(
"data" => array(
"is_active" => "1",
"name" => "asd",
"firstname" => "Schaefer",
"born_at" => "2012-05-23",
"gender" => "1",
"address" => array(
"city" => "Erftstadt",
"zip" => "50374"
),
"myObject" => new Beta
)
);
$check = new InputValidator();
$check->execute($data, $definition);
if($check->hasError()){
print_r($check->getError());
}
|