public function getCode(DependencyInterface $dependency) : Code
    {
        if ($dependency instanceof Dependency) {
            return $this->getDependencyCode($dependency);
        } elseif ($dependency instanceof Instance) {
            return $this->getInstanceCode($dependency);
        } elseif ($dependency instanceof DependencyProvider) {
            return $this->getProviderCode($dependency);
        }

        throw new \DomainException(\get_class($dependency));
    }