updated packages
This commit is contained in:
@@ -31,7 +31,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
|
||||
public function getTraces($pathinfo)
|
||||
{
|
||||
$this->traces = array();
|
||||
$this->traces = [];
|
||||
|
||||
try {
|
||||
$this->match($pathinfo);
|
||||
@@ -57,7 +57,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
|
||||
if (!preg_match($compiledRoute->getRegex(), $pathinfo, $matches)) {
|
||||
// does it match without any requirements?
|
||||
$r = new Route($route->getPath(), $route->getDefaults(), array(), $route->getOptions());
|
||||
$r = new Route($route->getPath(), $route->getDefaults(), [], $route->getOptions());
|
||||
$cr = $r->compile();
|
||||
if (!preg_match($cr->getRegex(), $pathinfo)) {
|
||||
$this->addTrace(sprintf('Path "%s" does not match', $route->getPath()), self::ROUTE_DOES_NOT_MATCH, $name, $route);
|
||||
@@ -66,7 +66,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
}
|
||||
|
||||
foreach ($route->getRequirements() as $n => $regex) {
|
||||
$r = new Route($route->getPath(), $route->getDefaults(), array($n => $regex), $route->getOptions());
|
||||
$r = new Route($route->getPath(), $route->getDefaults(), [$n => $regex], $route->getOptions());
|
||||
$cr = $r->compile();
|
||||
|
||||
if (\in_array($n, $cr->getVariables()) && !preg_match($cr->getRegex(), $pathinfo)) {
|
||||
@@ -80,7 +80,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
}
|
||||
|
||||
// check host requirement
|
||||
$hostMatches = array();
|
||||
$hostMatches = [];
|
||||
if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) {
|
||||
$this->addTrace(sprintf('Host "%s" does not match the requirement ("%s")', $this->context->getHost(), $route->getHost()), self::ROUTE_ALMOST_MATCHES, $name, $route);
|
||||
|
||||
@@ -105,7 +105,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
|
||||
// check condition
|
||||
if ($condition = $route->getCondition()) {
|
||||
if (!$this->getExpressionLanguage()->evaluate($condition, array('context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)))) {
|
||||
if (!$this->getExpressionLanguage()->evaluate($condition, ['context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)])) {
|
||||
$this->addTrace(sprintf('Condition "%s" does not evaluate to "true"', $condition), self::ROUTE_ALMOST_MATCHES, $name, $route);
|
||||
|
||||
continue;
|
||||
@@ -131,11 +131,11 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
|
||||
private function addTrace($log, $level = self::ROUTE_DOES_NOT_MATCH, $name = null, $route = null)
|
||||
{
|
||||
$this->traces[] = array(
|
||||
$this->traces[] = [
|
||||
'log' => $log,
|
||||
'name' => $name,
|
||||
'level' => $level,
|
||||
'path' => null !== $route ? $route->getPath() : null,
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user