protected function decodeFile(\SplFileInfo $file, $strict = true)
    {
        $mimeType = $file->getExtension();

        $this->checkAndAddDefaultDecoder($mimeType);

        if ($this->isSupportedMimeType($mimeType)) {

            if (is_readable($file->getPathname())) {
                $data = $this->getFileContents($file);
            } else {
                if ($strict) {
                    throw new \Exception("File not found: {$file->getPathname()}");
                } else {
                    return [];
                }
            }

            return $this->decoders[$mimeType]->decode($data);
        }

        $this->unsupportedFiles[] = $file->getFilename();
        return false;
    }
protected function decodeFile(\SplFileInfo $file, $strict = true)
    {
        $mimeType = $file->getExtension();

        $this->checkAndAddDefaultDecoder($mimeType);

        if ($this->isSupportedMimeType($mimeType)) {

            if (is_readable($file->getPathname())) {
                $data = $this->getFileContents($file);
            } else {
                if ($strict) {
                    throw new \Exception("File not found: {$file->getPathname()}");
                } else {
                    return [];
                }
            }

            return $this->decoders[$mimeType]->decode($data);
        }

        $this->unsupportedFiles[] = $file->getFilename();
        return false;
    }
protected function decodeFile ( \ SplFileInfo $ file , $ strict = true ) { $ mimeType = $ file -> getExtension ( ) ; $ this -> checkAndAddDefaultDecoder ( $ mimeType ) ; if ( $ this -> isSupportedMimeType ( $ mimeType ) ) { if ( is_readable ( $ file -> getPathname ( ) ) ) { $ data = $ this -> getFileContents ( $ file ) ; } else { if ( $ strict ) { throw new \ Exception ( "File not found: {$file->getPathname()}" ) ; } else { return [ ] ; } } return $ this -> decoders [ $ mimeType ] -> decode ( $ data ) ; } $ this -> unsupportedFiles [ ] = $ file -> getFilename ( ) ; return false ; }
Decodes a single file using registered decoders
@param \SplFileInfo $file
@param bool $strict
@return array|bool
@throws Exception
Decodes a single file using registered decoders