src/Sulu/Bundle/MediaBundle/Media/FormatCache/LocalFormatCache.php
protected function getFormatFromUrl($url)
    {
        $path = dirname($url);

        $formatParts = array_reverse(explode('/', $path));

        if (count($formatParts) < 2) {
            throw new ImageProxyInvalidUrl('No `format` was found in the url');
        }

        $format = $formatParts[1];

        return $format;
    }
protected function getFormatFromUrl($url)
    {
        $path = dirname($url);

        $formatParts = array_reverse(explode('/', $path));

        if (count($formatParts) < 2) {
            throw new ImageProxyInvalidUrl('No `format` was found in the url');
        }

        $format = $formatParts[1];

        return $format;
    }
protected function getFormatFromUrl ( $ url ) { $ path = dirname ( $ url ) ; $ formatParts = array_reverse ( explode ( '/' , $ path ) ) ; if ( count ( $ formatParts ) < 2 ) { throw new ImageProxyInvalidUrl ( 'No `format` was found in the url' ) ; } $ format = $ formatParts [ 1 ] ; return $ format ; }
return the format by a given url.

@param string $url

@return string

@throws \Sulu\Bundle\MediaBundle\Media\Exception\ImageProxyInvalidUrl
return the format by a given url .