Prevent fatal error, if channel has already closed connection
Added missing phpdoc