src/Eloquent/Typhoon/Generator/ValidatorClassGenerator.php
public function generateSyntaxTree(
        RuntimeConfiguration $configuration,
        ClassDefinition $classDefinition,
        &$className = null
    ) {
        $this->typeCheck->generateSyntaxTree(func_get_args());

        $className = $this->validatorClassName(
            $configuration,
            $classDefinition
        );

        $classDefinitionASTNode = new ClassDefinitionASTNode(
            new Identifier($className->shortName()->string())
        );
        $classDefinitionASTNode->setParentName(QualifiedIdentifier::fromString(
            $configuration
                ->validatorNamespace()
                ->joinAtoms('AbstractValidator')
                ->string()
        ));
        foreach ($classDefinition->methods() as $methodDefinition) {
            $classDefinitionASTNode->add(
                $this->generateMethod($configuration, $classDefinition, $methodDefinition)
            );
        }

        $primaryBlock = new PhpBlock;
        $primaryBlock->add(new NamespaceStatement(QualifiedIdentifier::fromString(
            $className->parent()->toRelative()->string()
        )));
        $primaryBlock->add($classDefinitionASTNode);

        $syntaxTree = new SyntaxTree;
        $syntaxTree->add($primaryBlock);

        return $syntaxTree;
    }
public function generateSyntaxTree(
        RuntimeConfiguration $configuration,
        ClassDefinition $classDefinition,
        &$className = null
    ) {
        $this->typeCheck->generateSyntaxTree(func_get_args());

        $className = $this->validatorClassName(
            $configuration,
            $classDefinition
        );

        $classDefinitionASTNode = new ClassDefinitionASTNode(
            new Identifier($className->shortName()->string())
        );
        $classDefinitionASTNode->setParentName(QualifiedIdentifier::fromString(
            $configuration
                ->validatorNamespace()
                ->joinAtoms('AbstractValidator')
                ->string()
        ));
        foreach ($classDefinition->methods() as $methodDefinition) {
            $classDefinitionASTNode->add(
                $this->generateMethod($configuration, $classDefinition, $methodDefinition)
            );
        }

        $primaryBlock = new PhpBlock;
        $primaryBlock->add(new NamespaceStatement(QualifiedIdentifier::fromString(
            $className->parent()->toRelative()->string()
        )));
        $primaryBlock->add($classDefinitionASTNode);

        $syntaxTree = new SyntaxTree;
        $syntaxTree->add($primaryBlock);

        return $syntaxTree;
    }
@param RuntimeConfiguration $configuration
@param ClassDefinition      $classDefinition
@param null                 &$className

@return SyntaxTree