| Conditions | 8 |
| Paths | 16 |
| Total Lines | 23 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 14 | public function createUrl($manager, $route, $params) |
||
|
|
|||
| 15 | { |
||
| 16 | /** @var Page $model */ |
||
| 17 | if ($route == 'page/page/show' || $route == 'page/page/list') { |
||
| 18 | $model=null; |
||
| 19 | if (isset($params['model'])) { |
||
| 20 | $model = $params['model']; |
||
| 21 | unset($params['model']); |
||
| 22 | } else { |
||
| 23 | if (isset($params['id'])) { |
||
| 24 | $model = Page::findById($params['id']); |
||
| 25 | unset($params['id']); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | if (null !== $model) { |
||
| 29 | $url = ($model->slug_compiled === ':mainpage:') ? '' : $model->slug_compiled; |
||
| 30 | $_query = http_build_query($params); |
||
| 31 | $url = (!empty($_query)) ? $url . '?' . $_query : $url; |
||
| 32 | return $url; |
||
| 33 | } |
||
| 34 | } |
||
| 35 | return false; |
||
| 36 | } |
||
| 37 | |||
| 60 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.