From 70bb159d2d9ce1ae2e75359d16166e5be1981d0c Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Sat, 28 Jul 2018 08:10:17 +0100 Subject: [PATCH] Add to string to Response --- .gitignore | 1 + composer.json | 3 ++- src/Services/Response.php | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 081911f..b4c538f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /.idea /.test /build +/docs /vendor composer.lock .DS_Store \ No newline at end of file diff --git a/composer.json b/composer.json index c2cc65c..2a49686 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,8 @@ "require-dev": { "phpunit/phpunit": "^6|^7", "mockery/mockery": "^1.1", - "satooshi/php-coveralls": "1.0.*" + "satooshi/php-coveralls": "1.0.*", + "symfony/finder": "^4.1" }, "autoload": { "psr-4": { diff --git a/src/Services/Response.php b/src/Services/Response.php index 742e9f7..d55d148 100644 --- a/src/Services/Response.php +++ b/src/Services/Response.php @@ -234,4 +234,14 @@ public function get($key) { return ! empty($this->attributes[$key]) ? $this->attributes[$key] : null; } + + /** + * To String + * + * @return string + */ + public function __toString() + { + return json_encode($this->attributes); + } } \ No newline at end of file