From aa3b8486a850321a289adbdf5facb5e51c3e5cb5 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Wed, 16 Oct 2019 10:44:20 +0200 Subject: [PATCH] Add FtpClient::isConnected() --- src/FtpClient.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/FtpClient.php b/src/FtpClient.php index 853555f..8f26e43 100644 --- a/src/FtpClient.php +++ b/src/FtpClient.php @@ -59,6 +59,16 @@ public function close() : void $this->conn = null; } + /** + * Returns whether a connection is currently open. + * + * @return bool + */ + public function isConnected() : bool + { + return $this->conn !== null; + } + /** * Logs in to the FTP connection. *