Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
BasicAuthorizerBase | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
authorize | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
createRequestAuthorizer | n/a |
0 / 0 |
n/a |
0 / 0 |
0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Rest\BasicAccess; |
4 | |
5 | use MediaWiki\Rest\Handler; |
6 | use MediaWiki\Rest\RequestInterface; |
7 | |
8 | /** |
9 | * An implementation of BasicAuthorizerInterface which creates a request-local |
10 | * object (a request authorizer) to do the actual authorization. |
11 | * |
12 | * @internal |
13 | */ |
14 | abstract class BasicAuthorizerBase implements BasicAuthorizerInterface { |
15 | public function authorize( RequestInterface $request, Handler $handler ) { |
16 | return $this->createRequestAuthorizer( $request, $handler )->authorize(); |
17 | } |
18 | |
19 | /** |
20 | * Create a BasicRequestAuthorizer to authorize the request. |
21 | * |
22 | * @param RequestInterface $request |
23 | * @param Handler $handler |
24 | * @return BasicRequestAuthorizer |
25 | */ |
26 | abstract protected function createRequestAuthorizer( RequestInterface $request, |
27 | Handler $handler ): BasicRequestAuthorizer; |
28 | } |