| 1 | <?php |
||
| 19 | class MultiStrategy implements StrategyInterface |
||
| 20 | { |
||
| 21 | /** @var StrategyInterface[] */ |
||
| 22 | private $strategies; |
||
| 23 | |||
| 24 | /** @var Role[] */ |
||
| 25 | private $roles= []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * MultiStrategy constructor. |
||
| 29 | * |
||
| 30 | * @param StrategyInterface[] $strategies List of strategies to be applied. |
||
| 31 | */ |
||
| 32 | 2 | public function __construct(array $strategies) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Applies the defined strategies on the provided request. |
||
| 39 | * |
||
| 40 | * @param Request $request request to handle |
||
| 41 | * |
||
| 42 | * @return string |
||
|
|
|||
| 43 | */ |
||
| 44 | public function apply(Request $request) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Decider to stop other strategies running after from being considered. |
||
| 60 | * |
||
| 61 | * @return boolean |
||
| 62 | */ |
||
| 63 | public function stopPropagation() |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Provides the list of registered roles. |
||
| 70 | * |
||
| 71 | * @return Role[] |
||
| 72 | */ |
||
| 73 | public function getRoles() |
||
| 77 | } |
||
| 78 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.