public function injectDependencies(DescriptorInterface $objectDescriptor, $instance)
    {

        // try to load the reflection class
        $reflectionClass = $this->getReflectionClass($objectDescriptor->getClassName());

        // load the dependencies for the passed descriptor
        $dependencies = $this->loadDependencies($objectDescriptor);

        // iterate over all methods and inject the dependencies
        foreach ($dependencies['method'] as $methodName => $toInject) {
            // query whether or not the method exists
            if ($reflectionClass->hasMethod($methodName)) {
                // inject the target by invoking the method
                call_user_func_array(array($instance, $methodName), $toInject);
            }
        }

        // inject dependencies by property
        foreach ($dependencies['property'] as $propertyName => $toInject) {
            // query whether or not the property exists
            if ($reflectionClass->hasProperty($propertyName)) {
                // load the reflection property
                $reflectionProperty = $reflectionClass->getProperty($propertyName);

                // load the PHP ReflectionProperty instance to inject the bean instance
                $phpReflectionProperty = $reflectionProperty->toPhpReflectionProperty();
                $phpReflectionProperty->setAccessible(true);
                $phpReflectionProperty->setValue($instance, $toInject);
            }
        }
    }