Exemplo n.º 1
0
 public function visitArray(array $data, Property\ArrayType $property, $path)
 {
     if ($this->validate) {
         parent::visitArray($data, $property, $path);
     }
     return $this->createSimpleProperty($data, $property);
 }
Exemplo n.º 2
0
 /**
  * @expectedException \PSX\Data\Schema\ValidationException
  */
 public function testVisitArrayMaxLength()
 {
     $visitor = new ValidationVisitor();
     $property = Property::getArray('test')->setPrototype(Property::getString('foo'));
     $property->setMaxLength(1);
     $this->assertEquals(1, $property->getMaxLength());
     $visitor->visitArray(array('foo', 'bar'), $property, '');
 }