Browse Source

Fix error reported by phpstan.

ADmad 7 years ago
parent
commit
75335d22d8
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/Error/ExceptionRenderer.php

+ 5 - 5
src/Error/ExceptionRenderer.php

@@ -22,6 +22,7 @@ use Cake\Core\Exception\MissingPluginException;
 use Cake\Event\Event;
 use Cake\Http\Exception\HttpException;
 use Cake\Http\Response;
+use Cake\Http\ServerRequest;
 use Cake\Http\ServerRequestFactory;
 use Cake\Routing\DispatcherFactory;
 use Cake\Routing\Router;
@@ -29,7 +30,6 @@ use Cake\Utility\Inflector;
 use Cake\View\Exception\MissingTemplateException;
 use Exception;
 use PDOException;
-use Psr\Http\Message\ServerRequestInterface;
 
 /**
  * Exception Renderer.
@@ -83,7 +83,7 @@ class ExceptionRenderer implements ExceptionRendererInterface
      * If set, this will be request used to create the controller that will render
      * the error.
      *
-     * @var \Psr\Http\Message\ServerRequestInterface|null
+     * @var \Cake\Http\ServerRequest|null
      */
     protected $request = null;
 
@@ -93,9 +93,9 @@ class ExceptionRenderer implements ExceptionRendererInterface
      * code error depending on the code used to construct the error.
      *
      * @param \Exception $exception Exception.
-     * @param \Psr\Http\Message\ServerRequestInterface $request The request - if this is set it will be used instead of creating a new one
+     * @param \Cake\Http\ServerRequest $request The request - if this is set it will be used instead of creating a new one
      */
-    public function __construct(Exception $exception, ServerRequestInterface $request = null)
+    public function __construct(Exception $exception, ServerRequest $request = null)
     {
         $this->error = $exception;
         $this->request = $request;
@@ -137,7 +137,7 @@ class ExceptionRenderer implements ExceptionRendererInterface
             $namespace = 'Controller';
             $prefix = $request->getParam('prefix');
             if ($prefix) {
-                if (strpos($request->getParam('prefix'), '/') === false) {
+                if (strpos($prefix, '/') === false) {
                     $namespace .= '/' . Inflector::camelize($prefix);
                 } else {
                     $prefixes = array_map(