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

        $className = $configuration
            ->validatorNamespace()
            ->joinAtoms('TypeInspector')
        ;

        $classDefinition = new ClassDefinition(
            new Identifier($className->shortName()->string())
        );
        $classDefinition->add($this->generateTypeMethod());
        $classDefinition->add($this->generateArrayTypeMethod());
        $classDefinition->add($this->generateObjectTypeMethod());
        $classDefinition->add($this->generateTraversableSubTypesMethod());
        $classDefinition->add($this->generateResourceTypeMethod());
        $classDefinition->add($this->generateStreamTypeMethod());

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

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

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

        $className = $configuration
            ->validatorNamespace()
            ->joinAtoms('TypeInspector')
        ;

        $classDefinition = new ClassDefinition(
            new Identifier($className->shortName()->string())
        );
        $classDefinition->add($this->generateTypeMethod());
        $classDefinition->add($this->generateArrayTypeMethod());
        $classDefinition->add($this->generateObjectTypeMethod());
        $classDefinition->add($this->generateTraversableSubTypesMethod());
        $classDefinition->add($this->generateResourceTypeMethod());
        $classDefinition->add($this->generateStreamTypeMethod());

        $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