Quick fix to DefaultRegistration

This commit is contained in:
Dave M. 2020-03-31 10:57:26 -04:00
parent dcb22fe086
commit 3044b919bc
2 changed files with 3 additions and 6 deletions

View File

@ -78,6 +78,7 @@ class DefaultRegistrations implements LanguageRegistration
public function registerExtension(Compiler $compiler) : void
{
$compiler->registerExtension(new \Picea\Extension\PhpExtension());
$compiler->registerExtension(new \Picea\Extension\JsonExtension($this->context));
$compiler->registerExtension(new \Picea\Extension\AssetExtension());

View File

@ -48,17 +48,13 @@ class Request implements Extension {
{
return $variableName === null ? $this->request->getParsedBody() : static::arrayGet($this->request->getParsedBody(), $variableName) ?? $default;
}
<<<<<<< Updated upstream
public function server(? string $variableName = null, $default = null)
=======
public function request(? string $variableName = null)
{
return $this->post($variableName) ?? $this->get($variableName);
return $variableName === null ? array_merge(get(null), post(null)) : $this->post($variableName) ?? $this->get($variableName);
}
public function server(? string $variableName = null)
>>>>>>> Stashed changes
{
return $variableName === null ? $this->request->getServerParams() : static::arrayGet($this->request->getServerParams(), $variableName) ?? $default;
}