Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| HookRunner | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| onRestCheckCanExecute | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Rest\Hook; |
| 4 | |
| 5 | use MediaWiki\HookContainer\HookContainer; |
| 6 | use MediaWiki\Rest\Handler; |
| 7 | use MediaWiki\Rest\HttpException; |
| 8 | use MediaWiki\Rest\Module\Module; |
| 9 | use MediaWiki\Rest\RequestInterface; |
| 10 | |
| 11 | class HookRunner implements RestCheckCanExecuteHook { |
| 12 | |
| 13 | private HookContainer $container; |
| 14 | |
| 15 | public function __construct( HookContainer $container ) { |
| 16 | $this->container = $container; |
| 17 | } |
| 18 | |
| 19 | public function onRestCheckCanExecute( |
| 20 | Module $module, |
| 21 | Handler $handler, |
| 22 | string $path, |
| 23 | RequestInterface $request, |
| 24 | ?HttpException &$error |
| 25 | ): bool { |
| 26 | return $this->container->run( |
| 27 | 'RestCheckCanExecute', |
| 28 | [ $module, $handler, $path, $request, &$error ] |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | } |