Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

call $e->getRequest() only when it is used at RouteNotFoundStrategy::handleRouteNotFoundError() by move it to the line that actually will use it in next flow #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/View/RouteNotFoundStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public function handleRouteNotFoundError(MvcEvent $e)
}

$response = $e->getResponse();
$request = $e->getRequest();

switch ($error) {
case Application::ERROR_CONTROLLER_NOT_FOUND:
Expand Down Expand Up @@ -139,6 +138,7 @@ public function handleRouteNotFoundError(MvcEvent $e)
throw new RuntimeException('Cannot access Console adapter - is it defined in ServiceManager?');
}

$request = $e->getRequest();
// Retrieve the script's name (entry point)
$scriptName = '';
if ($request instanceof ConsoleRequest) {
Expand Down