protected function collectExtensions($name)
    {

        $extensions = [];

        foreach ($this->extensions() as $pattern) {
            if ($this->patternMatches($pattern, $name)) {
                $extensions[] = $this->getExtension($pattern);
            }
        }

        return $extensions;

    }