| 1 | <?php |
||
| 12 | class AttributeMapper |
||
| 13 | { |
||
| 14 | use Utils\AttributeTrait; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | private $mapping = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Example:. |
||
| 23 | * |
||
| 24 | * [ |
||
| 25 | * BasicAuthentication::KEY => 'basic.username' |
||
| 26 | * ] |
||
| 27 | * |
||
| 28 | * @param array $mapping |
||
| 29 | */ |
||
| 30 | public function __construct(array $mapping) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Execute the middleware. |
||
| 37 | * |
||
| 38 | * @param ServerRequestInterface $request |
||
| 39 | * @param ResponseInterface $response |
||
| 40 | * @param callable $next |
||
| 41 | * |
||
| 42 | * @return ResponseInterface |
||
| 43 | */ |
||
| 44 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
| 55 | } |
||
| 56 |