diff --git a/src/Deployment/FtpServer.php b/src/Deployment/FtpServer.php index d60aa88..2d93251 100644 --- a/src/Deployment/FtpServer.php +++ b/src/Deployment/FtpServer.php @@ -55,6 +55,17 @@ public function __construct( } + /** + * Suppresses error on closing. + */ + public function __destruct(): void + { + if ($this->connection) { + @ftp_close($this->connection); // @ may fail + } + } + + /** * Connects to FTP server. * @throws ServerException