public function apply(Rule $rule, $value)
    {
        if (!$this->container->has($rule->service)) {
            throw new \RuntimeException("Unable to find service '{$rule->service}' to execute defined rule.");
        }

        $service = $this->container->get($rule->service);

        if (! \is_callable([$service, $rule->method])) {
            throw new \RuntimeException("Unable to find the method '{$rule->method}' in service '{$rule->service}'.");
        }

        $method = $rule->method;

        return $service->$method($value);
    }