1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Canvas\Providers; |
6
|
|
|
|
7
|
|
|
use Canvas\Middleware\NotFoundMiddleware; |
8
|
|
|
use Baka\Router\Providers\MiddlewareProvider as BakaMiddlewareProvider; |
9
|
|
|
use Canvas\Middleware\AuthenticationMiddleware; |
10
|
|
|
use Canvas\Middleware\AclMiddleware; |
11
|
|
|
use Phalcon\Mvc\Micro; |
|
|
|
|
12
|
|
|
use Phalcon\Events\Manager; |
|
|
|
|
13
|
|
|
|
14
|
|
|
class MiddlewareProvider extends BakaMiddlewareProvider |
15
|
|
|
{ |
16
|
|
|
protected $canvasGlobalMiddlewares = [ |
17
|
|
|
// Before the handler has been executed |
18
|
|
|
NotFoundMiddleware::class => 'before', |
19
|
|
|
]; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* This are the routes you have access to via the Baka routes components. |
23
|
|
|
* |
24
|
|
|
* This follows the order you specify on this array so |
25
|
|
|
* - Token will run before Auth |
26
|
|
|
* |
27
|
|
|
* @var array |
28
|
|
|
*/ |
29
|
|
|
protected $canvasRouteMiddlewares = [ |
30
|
|
|
'auth.jwt' => AuthenticationMiddleware::class, |
31
|
|
|
'auth.acl' => AclMiddleware::class, |
32
|
|
|
]; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Attaches the middleware to the application. |
36
|
|
|
* |
37
|
|
|
* @param Micro $application |
38
|
|
|
* @param Manager $eventsManager |
39
|
|
|
*/ |
40
|
|
|
protected function attachMiddleware(Micro $application, Manager $eventsManager) |
41
|
|
|
{ |
42
|
|
|
/** |
43
|
|
|
* Merge canvas Middleware with the app middleware. |
44
|
|
|
*/ |
45
|
|
|
$this->globalMiddlewares = array_merge($this->globalMiddlewares, $this->canvasGlobalMiddlewares); |
46
|
|
|
$this->routeMiddlewares = array_merge($this->routeMiddlewares, $this->canvasRouteMiddlewares); |
47
|
|
|
|
48
|
|
|
parent::attachMiddleware($application, $eventsManager); |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths