public function addProvider($providerName, $consumer)
    {
        if (!class_exists($consumer) && !interface_exists($consumer)) {
            throw new InvalidArgumentException(
                'Consumer "'.$consumer.'" doesn\'t exist for provider "'.$providerName.'"'
            );
        }

        if (isset($this->providers[$providerName])) {
            throw new DuplicateProviderException($providerName);
        }

        $this->providers[$providerName] = ['consumer' => $consumer, 'scope' => 'global'];

        DomainEvents::dispatch(new AddedProviderEvent($providerName, $consumer));
    }