From a2b5cfb040fcb6bd0268b867af9946cc024399b1 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 7 Jul 2017 23:58:31 +0200 Subject: [PATCH 1/2] Make sure __toString does not throw exception (#28) * Make sure __toString does not throw exception * Bugfix --- src/Stream.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Stream.php b/src/Stream.php index 9f5677f..507f135 100644 --- a/src/Stream.php +++ b/src/Stream.php @@ -59,7 +59,11 @@ public function __construct($socket, $size = null) */ public function __toString() { - return (string) $this->getContents(); + try { + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } } /** From bd07d7eb3bd8bc5c29ca9b062a4d27d7728de671 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 8 Jul 2017 00:46:17 +0200 Subject: [PATCH 2/2] Added changelog (#29) --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e59903e..d262127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Change Log -## Unreleased +## 1.3.0 + + * Make sure `Stream::__toString` never throws exception + * Added more exception + * `BrokenPipeException` + * `ConnectionException` + * `InvalidRequestException` + * `SSLConnectionException` + +## 1.2.0 + + * Dropped PHP 5.4 support + * Using stable version of `php-http/discovery` ## 1.1.0