| @@ 11-46 (lines=36) @@ | ||
| 8 | /** |
|
| 9 | * @deprecated use AMQPProtocolException instead |
|
| 10 | */ |
|
| 11 | class AMQPException extends \Exception |
|
| 12 | { |
|
| 13 | /** @var string */ |
|
| 14 | public $amqp_reply_code; |
|
| 15 | ||
| 16 | /** @var int */ |
|
| 17 | public $amqp_reply_text; |
|
| 18 | ||
| 19 | /** @var \Exception */ |
|
| 20 | public $amqp_method_sig; |
|
| 21 | ||
| 22 | /** @var array */ |
|
| 23 | public $args; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @param string $reply_code |
|
| 27 | * @param int $reply_text |
|
| 28 | * @param \Exception $method_sig |
|
| 29 | */ |
|
| 30 | public function __construct($reply_code, $reply_text, $method_sig) |
|
| 31 | { |
|
| 32 | parent::__construct($reply_text, $reply_code); |
|
| 33 | ||
| 34 | $this->amqp_reply_code = $reply_code; // redundant, but kept for BC |
|
| 35 | $this->amqp_reply_text = $reply_text; // redundant, but kept for BC |
|
| 36 | $this->amqp_method_sig = $method_sig; |
|
| 37 | ||
| 38 | $ms = MiscHelper::methodSig($method_sig); |
|
| 39 | $PROTOCOL_CONSTANTS_CLASS = AbstractChannel::$PROTOCOL_CONSTANTS_CLASS; |
|
| 40 | $mn = isset($PROTOCOL_CONSTANTS_CLASS::$GLOBAL_METHOD_NAMES[$ms]) |
|
| 41 | ? $PROTOCOL_CONSTANTS_CLASS::$GLOBAL_METHOD_NAMES[$ms] |
|
| 42 | : $mn = ''; |
|
| 43 | ||
| 44 | $this->args = array($reply_code, $reply_text, $method_sig, $mn); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 8-44 (lines=37) @@ | ||
| 5 | use PhpAmqpLib\Channel\AbstractChannel; |
|
| 6 | use PhpAmqpLib\Helper\MiscHelper; |
|
| 7 | ||
| 8 | class AMQPProtocolException extends \Exception implements AMQPExceptionInterface |
|
| 9 | { |
|
| 10 | /** @var string */ |
|
| 11 | public $amqp_reply_code; |
|
| 12 | ||
| 13 | /** @var int */ |
|
| 14 | public $amqp_reply_text; |
|
| 15 | ||
| 16 | /** @var \Exception */ |
|
| 17 | public $amqp_method_sig; |
|
| 18 | ||
| 19 | /** @var array */ |
|
| 20 | public $args; |
|
| 21 | ||
| 22 | /** |
|
| 23 | * @param string $reply_code |
|
| 24 | * @param int $reply_text |
|
| 25 | * @param \Exception $method_sig |
|
| 26 | */ |
|
| 27 | public function __construct($reply_code, $reply_text, $method_sig) |
|
| 28 | { |
|
| 29 | parent::__construct($reply_text, $reply_code); |
|
| 30 | ||
| 31 | $this->amqp_reply_code = $reply_code; // redundant, but kept for BC |
|
| 32 | $this->amqp_reply_text = $reply_text; // redundant, but kept for BC |
|
| 33 | $this->amqp_method_sig = $method_sig; |
|
| 34 | ||
| 35 | $ms = MiscHelper::methodSig($method_sig); |
|
| 36 | ||
| 37 | $PROTOCOL_CONSTANTS_CLASS = AbstractChannel::$PROTOCOL_CONSTANTS_CLASS; |
|
| 38 | $mn = isset($PROTOCOL_CONSTANTS_CLASS::$GLOBAL_METHOD_NAMES[$ms]) |
|
| 39 | ? $PROTOCOL_CONSTANTS_CLASS::$GLOBAL_METHOD_NAMES[$ms] |
|
| 40 | : $mn = ''; |
|
| 41 | ||
| 42 | $this->args = array($reply_code, $reply_text, $method_sig, $mn); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||