正在显示
1 个修改的文件
包含
3 行增加
和
2 行删除
@@ -6,7 +6,7 @@ class ImapClient { | @@ -6,7 +6,7 @@ class ImapClient { | ||
6 | 6 | ||
7 | /** | 7 | /** |
8 | * 资源 | 8 | * 资源 |
9 | - * @var | 9 | + * @var resource|false |
10 | */ | 10 | */ |
11 | private $socket; | 11 | private $socket; |
12 | 12 | ||
@@ -23,6 +23,7 @@ class ImapClient { | @@ -23,6 +23,7 @@ class ImapClient { | ||
23 | 23 | ||
24 | public function __construct(string $host){ | 24 | public function __construct(string $host){ |
25 | $this->host = $host; | 25 | $this->host = $host; |
26 | + $this->socket = false; | ||
26 | } | 27 | } |
27 | 28 | ||
28 | public function open(){ | 29 | public function open(){ |
@@ -129,7 +130,7 @@ class ImapClient { | @@ -129,7 +130,7 @@ class ImapClient { | ||
129 | 130 | ||
130 | public function __destruct() | 131 | public function __destruct() |
131 | { | 132 | { |
132 | - @fclose($this->socket); | 133 | + if($this->socket) @fclose($this->socket); |
133 | unset($this->socket); | 134 | unset($this->socket); |
134 | // TODO: Implement __destruct() method. | 135 | // TODO: Implement __destruct() method. |
135 | } | 136 | } |
-
请 注册 或 登录 后发表评论