| Total Complexity | 4 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | class UrlManager extends \yii\web\UrlManager |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * The event name when registering RESTful Url Rules |
||
| 24 | */ |
||
| 25 | const EVENT_REGISTER_REST_URL_RULES = 'registerRestUrlRules'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var array the default configuration of URL rules. Individual rule configurations |
||
| 29 | * specified via [[rules]] will take precedence when the same property of the rule is configured. |
||
| 30 | */ |
||
| 31 | public $ruleConfig = ['class' => UrlRule::class]; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @inheritdoc |
||
| 35 | */ |
||
| 36 | public function __construct(array $config = []) |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | private function getRules() |
||
| 46 | { |
||
| 47 | $event = new RegisterUrlRulesEvent(); |
||
| 48 | $this->trigger( |
||
| 49 | self::EVENT_REGISTER_REST_URL_RULES, |
||
| 50 | $event |
||
| 51 | ); |
||
| 52 | |||
| 53 | return array_filter($event->rules); |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @inheritdoc |
||
| 58 | */ |
||
| 59 | public function parseRequest($request) |
||
| 66 | } |
||
| 67 | } |
||
| 68 |