| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 1 | public function search( |
|
| 42 | array $params, |
||
| 43 | ?string $formName = '' |
||
| 44 | ): ?ActiveDataProvider { |
||
| 45 | 1 | $this->load($params, $formName); |
|
| 46 | 1 | if (!$this->validate()) { |
|
| 47 | 1 | return null; |
|
| 48 | } |
||
| 49 | 1 | if (null === $this->rule) { |
|
| 50 | 1 | throw new NotFoundHttpException('Rule not found'); |
|
| 51 | } |
||
| 52 | 1 | $this->rule->checkAccess($params); |
|
|
|
|||
| 53 | 1 | $class = get_parent_class(); |
|
| 54 | |||
| 55 | 1 | return new ActiveDataProvider([ |
|
| 56 | 1 | 'query' => $class::find()->andFilterWhere([ |
|
| 57 | 1 | 'rule_id' => $this->rule_id, |
|
| 58 | 1 | 'created_by' => $this->created_by, |
|
| 59 | ]), |
||
| 63 |