public function registerProducerByClass($type, $producer_class)
    {
        if (class_exists($producer_class)) {
            $producer_class_reflection = new ReflectionClass($producer_class);

            if ($producer_class_reflection->implementsInterface(ProducerInterface::class)) {
                $this->registerProducer($type, new $producer_class($this->connection, $this));
            } else {
                throw new InvalidArgumentException("Class '$producer_class' does not implement '" . ProducerInterface::class . "' interface");
            }
        }
    }
public function registerProducerByClass($type, $producer_class)
    {
        if (class_exists($producer_class)) {
            $producer_class_reflection = new ReflectionClass($producer_class);

            if ($producer_class_reflection->implementsInterface(ProducerInterface::class)) {
                $this->registerProducer($type, new $producer_class($this->connection, $this));
            } else {
                throw new InvalidArgumentException("Class '$producer_class' does not implement '" . ProducerInterface::class . "' interface");
            }
        }
    }
public function registerProducerByClass ( $ type , $ producer_class ) { if ( class_exists ( $ producer_class ) ) { $ producer_class_reflection = new ReflectionClass ( $ producer_class ) ; if ( $ producer_class_reflection -> implementsInterface ( ProducerInterface :: class ) ) { $ this -> registerProducer ( $ type , new $ producer_class ( $ this -> connection , $ this ) ) ; } else { throw new InvalidArgumentException ( "Class '$producer_class' does not implement '" . ProducerInterface :: class . "' interface" ) ; } } }
Register producerby providing a producer class name.

@param string $type
@param string $producer_class
Register producerby providing a producer class name .