src/Deflection/Transformer.php
public function arrayToClassElement($definition)
    {
        $class = new Classes();
        if (isset($definition['docblock'])) {
            $docblock = $this->arrayToDocblockElement($definition['docblock']);
            $class->setDocbloc($docblock);
        }
        if (isset($definition['namespace'])) {
            $class->setNamespace($definition['namespace']);
        }
        if (isset($definition['name'])) {
            $class->setName($definition['name']);
        }
        if (isset($definition['extends'])) {
           $class->setExtends($definition['extends']);
        }
        if (isset($definition['implements'])) {
            foreach ($definition['implements'] as $interface) {
                $class->addImplements($interface);
            }
        }
        if (isset($definition['uses'])) {
            foreach ($definition['uses'] as $alias => $use) {
                $alias = is_string($alias) ? $alias : null;
                $class->addUse($use, $alias);
            }
        }
        if (isset($definition['functions'])) {
            foreach ($definition['functions'] as $definition) {
                $function = $this->arrayToFunctionElement($definition);
                $class->addFunction($function);
            }
        }
        return $class;
    }
public function arrayToClassElement($definition)
    {
        $class = new Classes();
        if (isset($definition['docblock'])) {
            $docblock = $this->arrayToDocblockElement($definition['docblock']);
            $class->setDocbloc($docblock);
        }
        if (isset($definition['namespace'])) {
            $class->setNamespace($definition['namespace']);
        }
        if (isset($definition['name'])) {
            $class->setName($definition['name']);
        }
        if (isset($definition['extends'])) {
           $class->setExtends($definition['extends']);
        }
        if (isset($definition['implements'])) {
            foreach ($definition['implements'] as $interface) {
                $class->addImplements($interface);
            }
        }
        if (isset($definition['uses'])) {
            foreach ($definition['uses'] as $alias => $use) {
                $alias = is_string($alias) ? $alias : null;
                $class->addUse($use, $alias);
            }
        }
        if (isset($definition['functions'])) {
            foreach ($definition['functions'] as $definition) {
                $function = $this->arrayToFunctionElement($definition);
                $class->addFunction($function);
            }
        }
        return $class;
    }
public function arrayToClassElement ( $ definition ) { $ class = new Classes ( ) ; if ( isset ( $ definition [ 'docblock' ] ) ) { $ docblock = $ this -> arrayToDocblockElement ( $ definition [ 'docblock' ] ) ; $ class -> setDocbloc ( $ docblock ) ; } if ( isset ( $ definition [ 'namespace' ] ) ) { $ class -> setNamespace ( $ definition [ 'namespace' ] ) ; } if ( isset ( $ definition [ 'name' ] ) ) { $ class -> setName ( $ definition [ 'name' ] ) ; } if ( isset ( $ definition [ 'extends' ] ) ) { $ class -> setExtends ( $ definition [ 'extends' ] ) ; } if ( isset ( $ definition [ 'implements' ] ) ) { foreach ( $ definition [ 'implements' ] as $ interface ) { $ class -> addImplements ( $ interface ) ; } } if ( isset ( $ definition [ 'uses' ] ) ) { foreach ( $ definition [ 'uses' ] as $ alias => $ use ) { $ alias = is_string ( $ alias ) ? $ alias : null ; $ class -> addUse ( $ use , $ alias ) ; } } if ( isset ( $ definition [ 'functions' ] ) ) { foreach ( $ definition [ 'functions' ] as $ definition ) { $ function = $ this -> arrayToFunctionElement ( $ definition ) ; $ class -> addFunction ( $ function ) ; } } return $ class ; }
Transform an array to a class element object

@param array $definition Class definitoion

@return Deflection\Element\Classes
Transform an array to a class element object