protected function findObjectMessageFactory($message) : ObjectMessageFactory
    {
        $messageClass = get_class($message);
        foreach ($this->objectMessageFactories as $class => $factory) {
            if ($class === $messageClass) {
                return $factory;
            }
        }
        return $this->defaultObjectMessageFactory;
    }
protected function findObjectMessageFactory($message) : ObjectMessageFactory
    {
        $messageClass = get_class($message);
        foreach ($this->objectMessageFactories as $class => $factory) {
            if ($class === $messageClass) {
                return $factory;
            }
        }
        return $this->defaultObjectMessageFactory;
    }
protected function findObjectMessageFactory ( $ message ) : ObjectMessageFactory { $ messageClass = get_class ( $ message ) ; foreach ( $ this -> objectMessageFactories as $ class => $ factory ) { if ( $ class === $ messageClass ) { return $ factory ; } } return $ this -> defaultObjectMessageFactory ; }
Finds the appropriate message factory for the given message.

@param $message
@return ObjectMessageFactory
Finds the appropriate message factory for the given message .