protected function factoryFilesTree($fileName, $fileType, $fileTemporaryName, $fileError, $fileSize)
    {
        if (false === is_array($fileError)) {
            return new Doozr_Request_File(
                [
                    'name'     => $fileName,
                    'type'     => $fileType,
                    'tmp_name' => $fileTemporaryName,
                    'error'    => $fileError,
                    'size'     => $fileSize,
                ]
            );
        }

        $filesTree = [];

        foreach ($fileError as $nodeName => $errorData) {
            $filesTree[$nodeName] = $this->factoryFilesTree(
                $fileName[$nodeName],
                $fileType[$nodeName],
                $fileTemporaryName[$nodeName],
                $errorData,
                $fileSize[$nodeName]
            );
        }

        return $filesTree;
    }
protected function factoryFilesTree($fileName, $fileType, $fileTemporaryName, $fileError, $fileSize)
    {
        if (false === is_array($fileError)) {
            return new Doozr_Request_File(
                [
                    'name'     => $fileName,
                    'type'     => $fileType,
                    'tmp_name' => $fileTemporaryName,
                    'error'    => $fileError,
                    'size'     => $fileSize,
                ]
            );
        }

        $filesTree = [];

        foreach ($fileError as $nodeName => $errorData) {
            $filesTree[$nodeName] = $this->factoryFilesTree(
                $fileName[$nodeName],
                $fileType[$nodeName],
                $fileTemporaryName[$nodeName],
                $errorData,
                $fileSize[$nodeName]
            );
        }

        return $filesTree;
    }
protected function factoryFilesTree ( $ fileName , $ fileType , $ fileTemporaryName , $ fileError , $ fileSize ) { if ( false === is_array ( $ fileError ) ) { return new Doozr_Request_File ( [ 'name' => $ fileName , 'type' => $ fileType , 'tmp_name' => $ fileTemporaryName , 'error' => $ fileError , 'size' => $ fileSize , ] ) ; } $ filesTree = [ ] ; foreach ( $ fileError as $ nodeName => $ errorData ) { $ filesTree [ $ nodeName ] = $ this -> factoryFilesTree ( $ fileName [ $ nodeName ] , $ fileType [ $ nodeName ] , $ fileTemporaryName [ $ nodeName ] , $ errorData , $ fileSize [ $ nodeName ] ) ; } return $ filesTree ; }
Recursive parses a passed uploaded file and builds the new structure.

@param array|string $fileName          Name(s) of the uploaded file(s)
@param array|string $fileType          Type(s) of the uploaded file(s)
@param array|string $fileTemporaryName Temporary name(s) of the uploaded file(s)
@param array|int    $fileError         Error(s) of the uploaded file(s)
@param array|int    $fileSize          Filesize(s) of the uploaded file(s)

@author Benjamin Carl <opensource@clickalicious.de>

@return array Uploaded file(s) in new structure (PSR).
Recursive parses a passed uploaded file and builds the new structure .