protected function checkSupports($ext, $resource)
    {
        if (!is_string($resource)) {
            return false;
        }

        $info = pathinfo($resource);
        $extension = $info['extension'];

        if ('dist' === $extension) {
            $extension = pathinfo($info['filename'], PATHINFO_EXTENSION);
        }

        if (is_string($ext)) {
            return ($ext === $extension);
        }

        if (is_array($ext)) {
            $supported = false;

            foreach ($ext as $value) {
                if ($value === $extension) {
                    $supported = true;
                    break;
                }
            }

            return $supported;
        }

        return false;
    }