1
<?php
2

3
namespace Nuwave\Lighthouse\Support\Compatibility;
4

5
use Laravel\Lumen\Application;
6
use Nuwave\Lighthouse\Support\Utils;
7

8
class LumenMiddlewareAdapter implements MiddlewareAdapter
9
{
10
    /**
11
     * @var \Laravel\Lumen\Application
12
     */
13
    protected $app;
14

15 0
    public function __construct(Application $app)
16
    {
17 0
        $this->app = $app;
18
    }
19

20
    /**
21
     * Get all of the defined middleware short-hand names.
22
     *
23
     * @return array<string>
24
     */
25 0
    public function getMiddleware(): array
26
    {
27
        // TODO remove once Lumen gains public access to the middleware/routeMiddleware
28 0
        $globalMiddleware = Utils::accessProtected($this->app, 'middleware', []);
29 0
        $routeMiddleware = Utils::accessProtected($this->app, 'routeMiddleware', []);
30

31 0
        return array_merge($globalMiddleware, $routeMiddleware);
32
    }
33

34
    /**
35
     * Get all of the defined middleware groups.
36
     *
37
     * @return array<string>
38
     */
39 0
    public function getMiddlewareGroups(): array
40
    {
41
        // Lumen doesn't have middleware groups
42 0
        return [];
43
    }
44
}

Read our documentation on viewing source code .

Loading