for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the PSR Http Framework.
*
* (c) Dan Smith <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Ds\Router;
use Ds\Router\Interfaces\RouterResponseInterface;
* RouterResponse Class.
* Contains information about matched Route.
* @package Rs\Router
* @author Dan Smith <[email protected]>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @link https://github.com/djsmithme/Router
class RouterResponse implements RouterResponseInterface
{
* @var int Response Status Code.
protected $statusCode;
* @var string|\Closure Route Handler.
protected $handler;
* @var array Route Query Params.
protected $vars = [];
* @var array Route Names
protected $names = [];
* Router Response constructor.
* @param int $statusCode
* @param string|\Closure $handler
* @param array $names
* @param array $vars
public function __construct(
$statusCode,
$handler,
array $names = [],
array $vars = []
)
$this->statusCode = $statusCode;
$this->handler = $handler;
$this->names = $names;
$this->vars = $vars;
}
* @inheritdoc
public function getHandler()
return $this->handler;
public function getStatusCode()
return $this->statusCode;
public function getVars()
return $this->vars;
public function getNames()
return $this->names;