| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public static function fromRoute($route) |
||
| 27 | { |
||
| 28 | if (!$route instanceof Ajde_Core_Route) { |
||
| 29 | $route = new Ajde_Core_Route($route); |
||
| 30 | } |
||
| 31 | $base = MODULE_DIR.$route->getModule().'/'; |
||
| 32 | $action = $route->getController() ? |
||
| 33 | $route->getController().'/'.$route->getAction() : |
||
| 34 | $route->getAction(); |
||
| 35 | $format = $route->getFormat(); |
||
| 36 | |||
| 37 | return new self($base, $action, $format); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: