public function invokeMethod($class, string $method, array $arguments = [], bool $dependencyInjection = true)
    {
        // Check validity of first argument
        if (!(is_object($class) || (is_string($class) && class_exists($class)))) {
            throw new InstantiatorException(sprintf('First argument must be a valid class name or an object, %s given', gettype($class)));
        }

        try {
            // Reflection of method
            $reflectionMethod = new \ReflectionMethod($class, $method);

            // Create object from class
            if (!$reflectionMethod->isStatic() && is_string($class)) {
                throw new InstantiatorException('First argument must be an object if you want call a non static method');
            }

            // Dependency injection?
            if ($dependencyInjection) {
                $arguments = $this->getDependencyInjectionParameters($reflectionMethod->getParameters(), $arguments);
            }
        } catch (InstantiatorException $e) {
            throw $e;
        } catch (\Exception $e) {
            throw new InstantiatorException(sprintf('Error during dependency injection of method "%s::%s"',
                                                    is_object($class) ? get_class($class) : $class,
                                                    $method), 0, $e);
        }

        // Static method
        if ($reflectionMethod->isStatic()) {
            return $reflectionMethod->invokeArgs(null, $arguments);
        }

        /** @var object $class */
        // Non static method
        return $reflectionMethod->invokeArgs($class, $arguments);
    }