/**
  * @param RuntimeConfiguration $configuration
  * @param null                 &$className
  *
  * @return SyntaxTree
  */
 public function generateSyntaxTree(RuntimeConfiguration $configuration, &$className = null)
 {
     $this->typeCheck->generateSyntaxTree(func_get_args());
     $className = $configuration->validatorNamespace()->joinAtoms('Exception', 'UnexpectedArgumentValueException');
     $classDefinition = new ClassDefinition(new Identifier($className->shortName()->string()), ClassModifier::FINAL_());
     $classDefinition->setParentName(QualifiedIdentifier::fromString('UnexpectedInputException'));
     $classDefinition->add($this->generateConstructor($configuration));
     $classDefinition->add($this->generateParameterNameMethod());
     $classDefinition->add($this->generateIndexMethod());
     $classDefinition->add($this->generateValueMethod());
     $classDefinition->add($this->generateExpectedTypeMethod());
     $classDefinition->add($this->generateTypeInspectorMethod());
     $classDefinition->add($this->generateUnexpectedTypeMethod());
     $classDefinition->add(new Property(new Identifier('parameterName'), AccessModifier::PRIVATE_()));
     $classDefinition->add(new Property(new Identifier('index'), AccessModifier::PRIVATE_()));
     $classDefinition->add(new Property(new Identifier('value'), AccessModifier::PRIVATE_()));
     $classDefinition->add(new Property(new Identifier('expectedValue'), AccessModifier::PRIVATE_()));
     $classDefinition->add(new Property(new Identifier('typeInspector'), AccessModifier::PRIVATE_()));
     $classDefinition->add(new Property(new Identifier('unexpectedValue'), AccessModifier::PRIVATE_()));
     $primaryBlock = new PhpBlock();
     $primaryBlock->add(new NamespaceStatement(QualifiedIdentifier::fromString($className->parent()->toRelative()->string())));
     $primaryBlock->add($classDefinition);
     $syntaxTree = new SyntaxTree();
     $syntaxTree->add($primaryBlock);
     return $syntaxTree;
 }
 /**
  * @param RuntimeConfiguration $configuration
  * @param null                 &$className
  *
  * @return SyntaxTree
  */
 public function generateSyntaxTree(RuntimeConfiguration $configuration, &$className = null)
 {
     $this->typeCheck->generateSyntaxTree(func_get_args());
     $className = $configuration->validatorNamespace()->joinAtoms('DummyValidator');
     $classDefinition = new ClassDefinition(new Identifier($className->shortName()->string()));
     $classDefinition->setParentName(QualifiedIdentifier::fromString('AbstractValidator'));
     $classDefinition->add($this->generateCallMethod());
     $primaryBlock = new PhpBlock();
     $primaryBlock->add(new NamespaceStatement(QualifiedIdentifier::fromString($className->parent()->toRelative()->string())));
     $primaryBlock->add($classDefinition);
     $syntaxTree = new SyntaxTree();
     $syntaxTree->add($primaryBlock);
     return $syntaxTree;
 }
 /**
  * @param RuntimeConfiguration $configuration
  * @param null                 &$className
  *
  * @return SyntaxTree
  */
 public function generateSyntaxTree(RuntimeConfiguration $configuration, &$className = null)
 {
     $this->typeCheck->generateSyntaxTree(func_get_args());
     $className = $configuration->validatorNamespace()->joinAtoms('Exception', 'UnexpectedInputException');
     $classDefinition = new ClassDefinition(new Identifier($className->shortName()->string()), ClassModifier::ABSTRACT_());
     $classDefinition->setParentName(QualifiedIdentifier::fromString('\\InvalidArgumentException'));
     $classDefinition->add($this->generateConstructor());
     $primaryBlock = new PhpBlock();
     $primaryBlock->add(new NamespaceStatement(QualifiedIdentifier::fromString($className->parent()->toRelative()->string())));
     $primaryBlock->add($classDefinition);
     $syntaxTree = new SyntaxTree();
     $syntaxTree->add($primaryBlock);
     return $syntaxTree;
 }