Skip to content

Commit 6e17aeb

Browse files
committed
Add a magic method for the string representation of a response status
1 parent d7e8c74 commit 6e17aeb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/WaterPipe/HTTP/Response/ResponseStatus.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ public function __construct($code = 200)
175175
}
176176
}
177177

178+
/**
179+
* Returns the string representation of this instance.
180+
*
181+
* @return string
182+
*/
183+
public function __toString()
184+
{
185+
return "{$this->_code} {$this->_description}";
186+
}
187+
178188
/**
179189
* @return int
180190
*/

0 commit comments

Comments
 (0)