Closed chrisShick closed 4 years ago
I think we also need this:
diff --git a/config/bootstrap.php b/config/bootstrap.php
index 203ff7d..e72638c 100644
--- a/config/bootstrap.php
+++ b/config/bootstrap.php
@@ -1,8 +1,8 @@
<?php
use Cake\Event\EventManager;
use Cake\Core\Configure;
-use Cake\Routing\Middleware\RoutingMiddleware;
-use Cors\Routing\Middleware\CorsMiddleware;
+use Cake\Middleware\RoutingMiddleware;
+use Cors\Middleware\CorsMiddleware;
Thank you. I'll test it within the week.
Also need to update AppExceptionRenderer. Here's updated diff on top @chrisShick's PR:
diff --git a/config/bootstrap.php b/config/bootstrap.php
index 203ff7d..e72638c 100644
--- a/config/bootstrap.php
+++ b/config/bootstrap.php
@@ -1,8 +1,8 @@
<?php
use Cake\Event\EventManager;
use Cake\Core\Configure;
-use Cake\Routing\Middleware\RoutingMiddleware;
-use Cors\Routing\Middleware\CorsMiddleware;
+use Cake\Middleware\RoutingMiddleware;
+use Cors\Middleware\CorsMiddleware;
/**
* Configuration
diff --git a/src/Error/AppExceptionRenderer.php b/src/Error/AppExceptionRenderer.php
index fd56188..a218534 100644
--- a/src/Error/AppExceptionRenderer.php
+++ b/src/Error/AppExceptionRenderer.php
@@ -1,6 +1,7 @@
<?php
namespace Cors\Error;
+use Cake\Controller\Controller;
use Cake\Core\Configure;
use Cors\Middleware\CorsMiddleware;
@@ -16,7 +17,7 @@ class AppExceptionRenderer extends BaseExceptionRenderer
*
* @return \Cake\Controller\Controller
*/
- protected function _getController()
+ protected function _getController() : Controller
{
$controller = parent::_getController();
$cors = new CorsMiddleware();
I have done a little bit of tinkering and have all the existing tests passing. @ozee31 double check that this works as intended.