protected function getFiles(FileBag $bag)
    {
        $files = [];
        $fileBag = $bag->all();
        $fileIterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($fileBag), \RecursiveIteratorIterator::SELF_FIRST);

        foreach ($fileIterator as $file) {
            if (is_array($file) || null === $file) {
                continue;
            }

            $files[] = $file;
        }

        return $files;
    }
protected function getFiles(FileBag $bag)
    {
        $files = [];
        $fileBag = $bag->all();
        $fileIterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($fileBag), \RecursiveIteratorIterator::SELF_FIRST);

        foreach ($fileIterator as $file) {
            if (is_array($file) || null === $file) {
                continue;
            }

            $files[] = $file;
        }

        return $files;
    }
protected function getFiles ( FileBag $ bag ) { $ files = [ ] ; $ fileBag = $ bag -> all ( ) ; $ fileIterator = new \ RecursiveIteratorIterator ( new \ RecursiveArrayIterator ( $ fileBag ) , \ RecursiveIteratorIterator :: SELF_FIRST ) ; foreach ( $ fileIterator as $ file ) { if ( is_array ( $ file ) || null === $ file ) { continue ; } $ files [ ] = $ file ; } return $ files ; }
Flattens a given filebag to extract all files.

@param FileBag $bag The filebag to use

@return array An array of files
Flattens a given filebag to extract all files .