Fixed conflicts added since latest commits
This commit is contained in:
parent
3044b919bc
commit
bf3816c3db
|
@ -15,14 +15,14 @@ class JsonExtension implements Extension {
|
|||
$this->register($context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token)
|
||||
{
|
||||
$flag = $this->flags;
|
||||
|
||||
switch ($token) {
|
||||
case "json.pretty":
|
||||
$flag = \JSON_PRETTY_PRINT;
|
||||
$flag |= \JSON_PRETTY_PRINT;
|
||||
break;
|
||||
|
||||
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) ) {
|
||||
$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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue