Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 12, 2021
1 parent 78fad1a commit 7f29e32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Application/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function processException(\Throwable $e): void
$this->httpResponse->setCode($e instanceof BadRequestException ? ($e->getHttpCode() ?: 404) : 500);
}

$args = ['exception' => $e, 'request' => end($this->requests) ?: null];
$args = ['exception' => $e, 'request' => Arrays::last($this->requests) ?: null];
if ($this->presenter instanceof UI\Presenter) {
try {
$this->presenter->forward(":$this->errorPresenter:", $args);
Expand Down
4 changes: 2 additions & 2 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public function sendTemplate(Template $template = null): void
}

if (!$template->getFile()) {
$file = strtr(reset($files), '/', DIRECTORY_SEPARATOR);
$file = strtr(Arrays::first($files), '/', DIRECTORY_SEPARATOR);
$this->error("Page not found. Missing template '$file'.");
}
}
Expand All @@ -489,7 +489,7 @@ public function findLayoutTemplateFile(): ?string
}

if ($this->layout) {
$file = strtr(reset($files), '/', DIRECTORY_SEPARATOR);
$file = strtr(Arrays::first($files), '/', DIRECTORY_SEPARATOR);
throw new Nette\FileNotFoundException("Layout not found. Missing template '$file'.");
}
return null;
Expand Down

0 comments on commit 7f29e32

Please sign in to comment.