Permalink
Browse files

added PHP 7.1 typehints

  • Loading branch information...
dg committed Mar 26, 2018
1 parent 913d84c commit 605d9d3dcd9051aa16106a6d997ac239cd818085
Showing with 4 additions and 7 deletions.
  1. +2 −2 app/presenters/Error4xxPresenter.php
  2. +1 −1 app/presenters/ErrorPresenter.php
  3. +1 −4 app/router/RouterFactory.php
@@ -9,7 +9,7 @@
class Error4xxPresenter extends Nette\Application\UI\Presenter
{
public function startup()
public function startup(): void
{
parent::startup();
if (!$this->getRequest()->isMethod(Nette\Application\Request::FORWARD)) {
@@ -18,7 +18,7 @@ public function startup()
}
public function renderDefault(Nette\Application\BadRequestException $exception)
public function renderDefault(Nette\Application\BadRequestException $exception): void
{
// load template 403.latte or 404.latte or ... 4xx.latte
$file = __DIR__ . "/templates/Error/{$exception->getCode()}.latte";
@@ -34,7 +34,7 @@ public function run(Nette\Application\Request $request): Nette\Application\IResp
}
$this->logger->log($exception, ILogger::EXCEPTION);
return new Responses\CallbackResponse(function (Http\IRequest $httpRequest, Http\IResponse $httpResponse) {
return new Responses\CallbackResponse(function (Http\IRequest $httpRequest, Http\IResponse $httpResponse): void {
if (preg_match('#^text/html(?:;|$)#', $httpResponse->getHeader('Content-Type'))) {
require __DIR__ . '/templates/Error/500.phtml';
}
@@ -13,10 +13,7 @@ class RouterFactory
{
use Nette\StaticClass;
/**
* @return Nette\Application\IRouter
*/
public static function createRouter()
public static function createRouter(): RouteList
{
$router = new RouteList;
$router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');

0 comments on commit 605d9d3

Please sign in to comment.