final private function get_argument_count($callback, $accepted_args = 1)
    {
        try {
            if (\is_string($callback) && \is_callable([$this, $callback])) {
                $reflector = new ReflectionMethod($this, $callback);
                return $reflector->getNumberOfParameters();
            }

            if (\is_object($callback) && $callback instanceof Closure) {
                $reflector = new ReflectionFunction($callback);
                return $reflector->getNumberOfParameters();
            }
        } catch (ReflectionException $exception) {
            \error_log($exception->getMessage());
        }

        return $accepted_args ? $accepted_args : 1;
    }