Refactor Response to current styleguide

This commit is contained in:
Lonnie Ezell 2015-11-30 23:27:28 -06:00
parent 38e932dd8b
commit 330c5a34e9
3 changed files with 8 additions and 8 deletions

View File

@ -124,7 +124,7 @@ class Response extends Message implements ResponseInterface
*
* @return int Status code.
*/
public function statusCode(): int
public function getStatusCode(): int
{
if (empty($this->statusCode))
{
@ -191,7 +191,7 @@ class Response extends Message implements ResponseInterface
*
* @return string
*/
public function reason(): string
public function getReason(): string
{
if (empty($this->reason))
{

View File

@ -23,7 +23,7 @@ interface ResponseInterface
*
* @return int Status code.
*/
public function statusCode(): int;
public function getStatusCode(): int;
//--------------------------------------------------------------------
@ -56,7 +56,7 @@ interface ResponseInterface
*
* @return string
*/
public function reason(): string;
public function getReason(): string;
//--------------------------------------------------------------------

View File

@ -10,7 +10,7 @@ class ResponseTest extends PHPUnit_Framework_TestCase
$response->setStatusCode(200);
$this->assertEquals(200, $response->statusCode());
$this->assertEquals(200, $response->getStatusCode());
}
//--------------------------------------------------------------------
@ -32,7 +32,7 @@ class ResponseTest extends PHPUnit_Framework_TestCase
$response->setStatusCode(200);
$this->assertEquals('OK', $response->reason());
$this->assertEquals('OK', $response->getReason());
}
//--------------------------------------------------------------------
@ -43,7 +43,7 @@ class ResponseTest extends PHPUnit_Framework_TestCase
$response->setStatusCode(200, 'Not the mama');
$this->assertEquals('Not the mama', $response->reason());
$this->assertEquals('Not the mama', $response->getReason());
}
//--------------------------------------------------------------------
@ -83,7 +83,7 @@ class ResponseTest extends PHPUnit_Framework_TestCase
$response = new Response();
$this->setExpectedException('BadMethodCallException', 'HTTP Response is missing a status code');
$response->statusCode();
$response->getStatusCode();
}
//--------------------------------------------------------------------