public function decodeFileBagData(FileBag $fileBag, $ns = true, $strict = true)
    {
        $decodedData = [];
        $files = $fileBag->getAllFileInfoObjects();
        if (empty($files)) {
            throw new Exception("FileBag is empty. Make sure you have initialized the FileLoader and added files.");
        }

        foreach ($files as $file) {
            list($namespace, $file) = $this->getFilesNamespace($file);

            // Decode the actual file and save data
            $fileData = $this->decodeFile($file, $strict);
            if (is_array($fileData)) {
                foreach ($fileData as $k => $v) {
                    if ($ns === true) {
                        $decodedData[$namespace][$k] = $v;
                    } else {
                        $decodedData[$k] = $v;
                    }
                }
            }
        }

        if (!empty($this->unsupportedFiles)) {
            $badFiles = implode(", ", $this->unsupportedFiles);
            throw new UnsupportedFilesException(
                'The file(s) ' . $badFiles . ' are not supported by the available decoders.'
            );
        }

        return $decodedData;
    }
public function decodeFileBagData(FileBag $fileBag, $ns = true, $strict = true)
    {
        $decodedData = [];
        $files = $fileBag->getAllFileInfoObjects();
        if (empty($files)) {
            throw new Exception("FileBag is empty. Make sure you have initialized the FileLoader and added files.");
        }

        foreach ($files as $file) {
            list($namespace, $file) = $this->getFilesNamespace($file);

            // Decode the actual file and save data
            $fileData = $this->decodeFile($file, $strict);
            if (is_array($fileData)) {
                foreach ($fileData as $k => $v) {
                    if ($ns === true) {
                        $decodedData[$namespace][$k] = $v;
                    } else {
                        $decodedData[$k] = $v;
                    }
                }
            }
        }

        if (!empty($this->unsupportedFiles)) {
            $badFiles = implode(", ", $this->unsupportedFiles);
            throw new UnsupportedFilesException(
                'The file(s) ' . $badFiles . ' are not supported by the available decoders.'
            );
        }

        return $decodedData;
    }
public function decodeFileBagData ( FileBag $ fileBag , $ ns = true , $ strict = true ) { $ decodedData = [ ] ; $ files = $ fileBag -> getAllFileInfoObjects ( ) ; if ( empty ( $ files ) ) { throw new Exception ( "FileBag is empty. Make sure you have initialized the FileLoader and added files." ) ; } foreach ( $ files as $ file ) { list ( $ namespace , $ file ) = $ this -> getFilesNamespace ( $ file ) ; // Decode the actual file and save data $ fileData = $ this -> decodeFile ( $ file , $ strict ) ; if ( is_array ( $ fileData ) ) { foreach ( $ fileData as $ k => $ v ) { if ( $ ns === true ) { $ decodedData [ $ namespace ] [ $ k ] = $ v ; } else { $ decodedData [ $ k ] = $ v ; } } } } if ( ! empty ( $ this -> unsupportedFiles ) ) { $ badFiles = implode ( ", " , $ this -> unsupportedFiles ) ; throw new UnsupportedFilesException ( 'The file(s) ' . $ badFiles . ' are not supported by the available decoders.' ) ; } return $ decodedData ; }
Process file bag to load into the data manager.
A file bag is an array of SplFileInfo objects.

@param array|FileBag $fileBag
@param bool $ns
@param bool $strict
@return array
@throws Exception
Process file bag to load into the data manager . A file bag is an array of SplFileInfo objects .