コード例 #1
0
ファイル: AssimilationVisitor.php プロジェクト: seytar/psx
 public function visitArray(array $data, Property\ArrayType $property, $path)
 {
     if ($this->validate) {
         parent::visitArray($data, $property, $path);
     }
     return $this->createSimpleProperty($data, $property);
 }
コード例 #2
0
ファイル: ValidationVisitorTest.php プロジェクト: seytar/psx
 /**
  * @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, '');
 }