Fixed conflicts added since latest commits
This commit is contained in:
parent
3044b919bc
commit
bf3816c3db
|
@ -22,7 +22,7 @@ class JsonExtension implements Extension {
|
||||||
|
|
||||||
switch ($token) {
|
switch ($token) {
|
||||||
case "json.pretty":
|
case "json.pretty":
|
||||||
$flag = \JSON_PRETTY_PRINT;
|
$flag |= \JSON_PRETTY_PRINT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "json.html":
|
case "json.html":
|
||||||
|
|
|
@ -170,6 +170,17 @@ class UrlExtension implements Extension {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ( array_key_exists($variable, $arguments) ) {
|
||||||
|
$value = $arguments[ $item[1] ];
|
||||||
|
}
|
||||||
|
else if ( isset($default) ) {
|
||||||
|
$value = $default;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$variable = $item[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( array_key_exists($variable, $arguments) ) {
|
if ( array_key_exists($variable, $arguments) ) {
|
||||||
$value = $arguments[ $item[1] ];
|
$value = $arguments[ $item[1] ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,12 +49,12 @@ class Request implements Extension {
|
||||||
return $variableName === null ? $this->request->getParsedBody() : static::arrayGet($this->request->getParsedBody(), $variableName) ?? $default;
|
return $variableName === null ? $this->request->getParsedBody() : static::arrayGet($this->request->getParsedBody(), $variableName) ?? $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function request(? string $variableName = null)
|
public function request(? string $variableName = null, $default = null)
|
||||||
{
|
{
|
||||||
return $variableName === null ? array_merge(get(null), post(null)) : $this->post($variableName) ?? $this->get($variableName);
|
return $variableName === null ? array_merge(get(null), post(null)) : $this->post($variableName) ?? $this->get($variableName) ?? $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function server(? string $variableName = null)
|
public function server(? string $variableName = null, $default = null)
|
||||||
{
|
{
|
||||||
return $variableName === null ? $this->request->getServerParams() : static::arrayGet($this->request->getServerParams(), $variableName) ?? $default;
|
return $variableName === null ? $this->request->getServerParams() : static::arrayGet($this->request->getServerParams(), $variableName) ?? $default;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue