protected function exclude(string $path): bool
    {
        foreach ($this->exclude as $pattern) {
            $replacements = [
                '\\,' => ',',
                '*' => '.*',
            ];

            $pattern = strtr($pattern, $replacements);

            if (preg_match("|{$pattern}|i", $path) === 1) {
                return true;
            }
        }

        return false;
    }