src/Service/AssetFilterManager.php
protected function getFilters($path, AssetInterface $asset)
    {
        $config = $this->getConfig();

        if (!empty($config[$path])) {
            return $config[$path];
        }

        if (!empty($asset->mimetype) && !empty($config[$asset->mimetype])) {
            return $config[$asset->mimetype];
        }

        $extension = strtolower(pathinfo($asset->getSourcePath(), PATHINFO_EXTENSION));

        if (!empty($config[$extension])) {
            return $config[$extension];
        }

        return [];
    }
protected function getFilters($path, AssetInterface $asset)
    {
        $config = $this->getConfig();

        if (!empty($config[$path])) {
            return $config[$path];
        }

        if (!empty($asset->mimetype) && !empty($config[$asset->mimetype])) {
            return $config[$asset->mimetype];
        }

        $extension = strtolower(pathinfo($asset->getSourcePath(), PATHINFO_EXTENSION));

        if (!empty($config[$extension])) {
            return $config[$extension];
        }

        return [];
    }
protected function getFilters ( $ path , AssetInterface $ asset ) { $ config = $ this -> getConfig ( ) ; if ( ! empty ( $ config [ $ path ] ) ) { return $ config [ $ path ] ; } if ( ! empty ( $ asset -> mimetype ) && ! empty ( $ config [ $ asset -> mimetype ] ) ) { return $ config [ $ asset -> mimetype ] ; } $ extension = strtolower ( pathinfo ( $ asset -> getSourcePath ( ) , PATHINFO_EXTENSION ) ) ; if ( ! empty ( $ config [ $ extension ] ) ) { return $ config [ $ extension ] ; } return [ ] ; }
Get the filters from config based on path, mimetype or extension.

@param string $path
@param AssetInterface $asset

@return array|mixed
Get the filters from config based on path mimetype or extension .