public function collection(string $collection, ?string $format = null) : string {
        list($collection, $extension) = preg_split('/\.(css|js)/', $collection, 2, PREG_SPLIT_DELIM_CAPTURE);

        $group = $extension == 'css' ? 'stylesheets' : 'javascripts';

        return $this->serve($collection, $group, $format);
    }
public function collection(string $collection, ?string $format = null) : string {
        list($collection, $extension) = preg_split('/\.(css|js)/', $collection, 2, PREG_SPLIT_DELIM_CAPTURE);

        $group = $extension == 'css' ? 'stylesheets' : 'javascripts';

        return $this->serve($collection, $group, $format);
    }
public function collection ( string $ collection , ? string $ format = null ) : string { list ( $ collection , $ extension ) = preg_split ( '/\.(css|js)/' , $ collection , 2 , PREG_SPLIT_DELIM_CAPTURE ) ; $ group = $ extension == 'css' ? 'stylesheets' : 'javascripts' ; return $ this -> serve ( $ collection , $ group , $ format ) ; }
Serve a collection where the group is determined by the the extension.
Serve a collection where the group is determined by the the extension .