protected function moveImportsToTop($content)
    {
        if (preg_match_all('/@import[^;]+;/', $content, $matches)) {
            // remove from content
            foreach ($matches[0] as $import) {
                $content = str_replace($import, '', $content);
            }

            // add to top
            $content = implode('', $matches[0]).$content;
        }

        return $content;
    }
protected function moveImportsToTop($content)
    {
        if (preg_match_all('/@import[^;]+;/', $content, $matches)) {
            // remove from content
            foreach ($matches[0] as $import) {
                $content = str_replace($import, '', $content);
            }

            // add to top
            $content = implode('', $matches[0]).$content;
        }

        return $content;
    }
protected function moveImportsToTop ( $ content ) { if ( preg_match_all ( '/@import[^;]+;/' , $ content , $ matches ) ) { // remove from content foreach ( $ matches [ 0 ] as $ import ) { $ content = str_replace ( $ import , '' , $ content ) ; } // add to top $ content = implode ( '' , $ matches [ 0 ] ) . $ content ; } return $ content ; }
Move any import statements to the top.

@param string $content Nearly finished CSS content

@return string
Move any import statements to the top .