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

Commit

Permalink
Implement lang.Closeable
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 10, 2017
1 parent dda08c4 commit 3dff4bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ Example
-------

```php
use org\nagios\nsca\NscaClient;
use org\nagios\nsca\NscaMessage;
use org\nagios\nsca\NscaProtocol;
use org\nagios\nsca\{NscaClient, NscaMessage, NscaProtocol};

$c= new NscaClient('nagios.example.com');
$c->connect();
Expand Down
6 changes: 3 additions & 3 deletions src/main/php/org/nagios/nsca/NscaClient.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @see http://nagios.sourceforge.net/download/cvs/nsca-cvs.tar.gz
* @see http://jasonplancaster.com/projects/scripts/send_nsca/send_nsca_pl.source
*/
class NscaClient {
class NscaClient implements \lang\Closeable {
public
$sock = null,
$version = 0,
Expand Down Expand Up @@ -196,10 +196,10 @@ public function toString() {
/**
* Closes the communication socket to the NSCA server
*
* @return bool
* @return void
*/
public function close() {
return $this->sock->isConnected() ? $this->sock->close() : TRUE;
$this->sock->isConnected() && $this->sock->close();
}

/**
Expand Down

0 comments on commit 3dff4bf

Please sign in to comment.