| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public static function formCrumbs($action, $params) |
||
| 35 | { |
||
| 36 | $class = static::actionToBreadcrumbClass($action); |
||
| 37 | $method = static::actionToBreadcrumbMethod($action); |
||
| 38 | |||
| 39 | if (class_exists($class) && method_exists($class, $method)) { |
||
| 40 | $reflectionMethod = new \ReflectionMethod($class, $method); |
||
| 41 | $data = []; |
||
| 42 | foreach ($reflectionMethod->getParameters() as $p) { |
||
| 43 | $data[] = $params[$p->getName()] ?? null; |
||
| 44 | } |
||
| 45 | return array_filter(\call_user_func_array([$class, $method], $data)); |
||
| 46 | } |
||
| 47 | |||
| 48 | return []; |
||
| 49 | } |
||
| 50 | } |