1 | <?php |
||
11 | class Rename |
||
12 | { |
||
13 | /** |
||
14 | * @var array Renamed paths |
||
15 | */ |
||
16 | private $paths = []; |
||
17 | |||
18 | /** |
||
19 | * Constructor. Set the paths. |
||
20 | * |
||
21 | * @param array|null $paths |
||
22 | */ |
||
23 | public function __construct(array $paths = null) |
||
29 | |||
30 | /** |
||
31 | * Map with the names. |
||
32 | * |
||
33 | * @param array $paths ['private-name' => 'public-name'] |
||
34 | * |
||
35 | * @return self |
||
36 | */ |
||
37 | public function paths(array $paths) |
||
43 | |||
44 | /** |
||
45 | * Execute the middleware. |
||
46 | * |
||
47 | * @param RequestInterface $request |
||
48 | * @param ResponseInterface $response |
||
49 | * @param callable $next |
||
50 | * |
||
51 | * @return ResponseInterface |
||
52 | */ |
||
53 | public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next) |
||
70 | } |
||
71 |