Skip to content

Commit 6028635

Browse files
committed
Instead of checking existence of is_open property, the property is now defined always
1 parent 4bcb13a commit 6028635

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

PhpAmqpLib/Channel/AMQPChannel.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ class AMQPChannel extends AbstractChannel
7575
*/
7676
private $publish_cache_max_size;
7777

78+
/**
79+
* Whether or not the channel has been "opened" or not
80+
* @var bool
81+
*/
82+
protected $is_open = false;
7883

7984

8085
public function __construct($connection, $channel_id = null, $auto_decode = true)
@@ -152,7 +157,7 @@ protected function channel_alert($args)
152157
*/
153158
public function close($reply_code = 0, $reply_text = "", $method_sig = array(0, 0))
154159
{
155-
if ((isset($this->is_open) && $this->is_open !== true) || !$this->connection || !$this->connection->isConnected()) {
160+
if ($this->is_open !== true || !$this->connection || !$this->connection->isConnected()) {
156161
$this->do_close();
157162
return; // already closed
158163
}

0 commit comments

Comments
 (0)