protected function checkSupports($ext, $resource)
    {
        if (!is_string($resource)) {
            return false;
        }

        $info = pathinfo($resource);
        $extension = $info['extension'];

        if ('dist' === $extension) {
            $extension = pathinfo($info['filename'], PATHINFO_EXTENSION);
        }

        if (is_string($ext)) {
            return ($ext === $extension);
        }

        if (is_array($ext)) {
            $supported = false;

            foreach ($ext as $value) {
                if ($value === $extension) {
                    $supported = true;
                    break;
                }
            }

            return $supported;
        }

        return false;
    }
protected function checkSupports($ext, $resource)
    {
        if (!is_string($resource)) {
            return false;
        }

        $info = pathinfo($resource);
        $extension = $info['extension'];

        if ('dist' === $extension) {
            $extension = pathinfo($info['filename'], PATHINFO_EXTENSION);
        }

        if (is_string($ext)) {
            return ($ext === $extension);
        }

        if (is_array($ext)) {
            $supported = false;

            foreach ($ext as $value) {
                if ($value === $extension) {
                    $supported = true;
                    break;
                }
            }

            return $supported;
        }

        return false;
    }
protected function checkSupports ( $ ext , $ resource ) { if ( ! is_string ( $ resource ) ) { return false ; } $ info = pathinfo ( $ resource ) ; $ extension = $ info [ 'extension' ] ; if ( 'dist' === $ extension ) { $ extension = pathinfo ( $ info [ 'filename' ] , PATHINFO_EXTENSION ) ; } if ( is_string ( $ ext ) ) { return ( $ ext === $ extension ) ; } if ( is_array ( $ ext ) ) { $ supported = false ; foreach ( $ ext as $ value ) { if ( $ value === $ extension ) { $ supported = true ; break ; } } return $ supported ; } return false ; }
Check if a resource has a given extension

@param $ext mixed  An extension or an arrayof extensions
@param $resource  string A resource
Check if a resource has a given extension