| Conditions | 4 |
| Paths | 5 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public static function rowButton($dataManager, $item, $params, $actionParams) |
||
|
1 ignored issue
–
show
|
|||
| 21 | {
|
||
| 22 | if (\App::$cur->name != 'admin') {
|
||
| 23 | return ''; |
||
| 24 | } |
||
| 25 | $query = [ |
||
| 26 | 'formName' => !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager', |
||
| 27 | 'redirectUrl' => !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : str_replace('\\', '/', $modelName)
|
||
| 28 | ]; |
||
| 29 | return "<a href='/admin/" . str_replace('\\', '/view/', get_class($item)) . "/{$item->pk()}?" . http_build_query($query) . "'><i class='glyphicon glyphicon-eye-open'></i></a>";
|
||
| 30 | } |
||
| 31 | |||
| 33 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: