/** * Create a new StorageError message. */ public function __construct() { if (self::$type === null) { self::$type = MessageFactory::getTypeIdByClass(__CLASS__); } }
/** * @expectedException \AlphaRPC\Common\Protocol\Exception\UnknownMessageException * @expectedExceptionMessage Class not registered: AlphaRPC\Common\Protocol\Message\NonExistentMessage. */ public function testGetTypeIdByClassThrowsExceptionWithIncorrectClass() { $class = 'AlphaRPC\\Common\\Protocol\\Message\\NonExistentMessage'; MessageFactory::getTypeIdByClass($class); }
/** * Returns the Message Type. * * @return int */ public function getType() { return MessageFactory::getTypeIdByClass(get_called_class()); }