public function matches(array $matchers, array $arguments): bool
    {
        $argumentCount = count($arguments);
        $index = 0;

        foreach ($matchers as $matcher) {
            if ($matcher instanceof WildcardMatcher) {
                $matchCount = 0;
                $innerMatcher = $matcher->matcher();

                while (
                    $index < $argumentCount &&
                    $innerMatcher->matches($arguments[$index])
                ) {
                    ++$matchCount;
                    ++$index;
                }

                $maximumArguments = $matcher->maximumArguments();

                $isMatch =
                    (
                        $maximumArguments < 0 ||
                        $matchCount <= $maximumArguments
                    ) &&
                    $matchCount >= $matcher->minimumArguments();

                if (!$isMatch) {
                    return false;
                }

                continue;
            }

            if (
                $index >= $argumentCount ||
                !$matcher->matches($arguments[$index])
            ) {
                return false;
            }

            ++$index;
        }

        return $index === $argumentCount;
    }