protected function decodeAsseticFilters(FilterManager $filterManager, $filters)
    {
        if (! empty($filters)) {
            $filter_list = \is_array($filters) ? $filters : explode(',', $filters);

            foreach ($filter_list as $filter_name) {
                $filter_name = trim($filter_name);

                foreach ($this->assetFilters as $filterIdentifier => $filterInstance) {
                    if ($filterIdentifier == $filter_name) {
                        $filterManager->set($filterIdentifier, $filterInstance);

                        // No, goto is not evil.
                        goto filterFound;
                    }
                }

                throw new \InvalidArgumentException("Unsupported Assetic filter: '$filter_name'");
                break;

                filterFound:
            }
        } else {
            $filter_list = array();
        }

        return $filter_list;
    }
protected function decodeAsseticFilters(FilterManager $filterManager, $filters)
    {
        if (! empty($filters)) {
            $filter_list = \is_array($filters) ? $filters : explode(',', $filters);

            foreach ($filter_list as $filter_name) {
                $filter_name = trim($filter_name);

                foreach ($this->assetFilters as $filterIdentifier => $filterInstance) {
                    if ($filterIdentifier == $filter_name) {
                        $filterManager->set($filterIdentifier, $filterInstance);

                        // No, goto is not evil.
                        goto filterFound;
                    }
                }

                throw new \InvalidArgumentException("Unsupported Assetic filter: '$filter_name'");
                break;

                filterFound:
            }
        } else {
            $filter_list = array();
        }

        return $filter_list;
    }
protected function decodeAsseticFilters ( FilterManager $ filterManager , $ filters ) { if ( ! empty ( $ filters ) ) { $ filter_list = \ is_array ( $ filters ) ? $ filters : explode ( ',' , $ filters ) ; foreach ( $ filter_list as $ filter_name ) { $ filter_name = trim ( $ filter_name ) ; foreach ( $ this -> assetFilters as $ filterIdentifier => $ filterInstance ) { if ( $ filterIdentifier == $ filter_name ) { $ filterManager -> set ( $ filterIdentifier , $ filterInstance ) ; // No, goto is not evil. goto filterFound ; } } throw new \ InvalidArgumentException ( "Unsupported Assetic filter: '$filter_name'" ) ; break ; filterFound : } } else { $ filter_list = array ( ) ; } return $ filter_list ; }
Decode the filters names, and initialize the Assetic FilterManager

@param  FilterManager             $filterManager the Assetic filter manager
@param  string|array              $filters       a comma separated list of filter names
@throws \InvalidArgumentException if a wrong filter is passed
@return array                     an array of filter names
Decode the filters names and initialize the Assetic FilterManager