Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Commit 3dff4bf

Browse files
committed
Implement lang.Closeable
1 parent dda08c4 commit 3dff4bf

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ Example
1616
-------
1717

1818
```php
19-
use org\nagios\nsca\NscaClient;
20-
use org\nagios\nsca\NscaMessage;
21-
use org\nagios\nsca\NscaProtocol;
19+
use org\nagios\nsca\{NscaClient, NscaMessage, NscaProtocol};
2220

2321
$c= new NscaClient('nagios.example.com');
2422
$c->connect();

src/main/php/org/nagios/nsca/NscaClient.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* @see http://nagios.sourceforge.net/download/cvs/nsca-cvs.tar.gz
3636
* @see http://jasonplancaster.com/projects/scripts/send_nsca/send_nsca_pl.source
3737
*/
38-
class NscaClient {
38+
class NscaClient implements \lang\Closeable {
3939
public
4040
$sock = null,
4141
$version = 0,
@@ -196,10 +196,10 @@ public function toString() {
196196
/**
197197
* Closes the communication socket to the NSCA server
198198
*
199-
* @return bool
199+
* @return void
200200
*/
201201
public function close() {
202-
return $this->sock->isConnected() ? $this->sock->close() : TRUE;
202+
$this->sock->isConnected() && $this->sock->close();
203203
}
204204

205205
/**

0 commit comments

Comments
 (0)