protected function resolveInstancePopulation($instance, ReflectionParameter $parameter, $value)
    {

        // Check if instance is populatable and if the given value
        // is an array.
        if ($instance instanceof Populatable && is_array($value)) {
            $instance->populate($value);

            return $instance;
        }

        // If we reach this part, then we are simply going to fail.
        // It is NOT safe to continue and make assumptions on how
        // we can populate the given instance. For this reason, we
        // just throw an exception
        $message = sprintf(
            'Unable to resolve dependency for property "%s" of the type "%s"; do not know how to populate with "%s"',
            $parameter->getName(),
            $parameter->getClass()->getName(),
            var_export($value, true)
        );

        throw new BindingResolutionException($message);
    }