for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @package Fuel\Routing
* @version 2.0
* @author Fuel Development Team
* @license MIT License
* @copyright 2010 - 2015 Fuel Development Team
* @link http://fuelphp.com
*/
namespace Fuel\Routing;
class Match
{
public $uri;
public $name;
public $action;
public $method;
public $translation;
public $parameters;
public $response;
public $namespace;
public $controller;
public function __construct(Route $route = null, $method, $uri, $translation, array $parameters = array(), $name = null)
$this->uri = $uri;
$this->name = $name;
$this->route = $route;
route
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
$this->method = $method;
$this->translation = $translation;
$this->parameters = $parameters;
}
public function setNamespace($namespace)
$this->namespace = trim($namespace, '\\').'\\';
return $this;
public function setController($controller)
$this->controller = trim($controller, '\\');
public function setAction($action)
$this->action = $action;
public function getSegments()
return explode('/', $this->uri);
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: