Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function process() |
||
20 | { |
||
21 | switch ($this->_attributeParse()) { |
||
22 | case 'render': |
||
23 | $image = new Ajde_Resource_Image($this->attributes['filename']); |
||
24 | $image->setWidth($this->attributes['width']); |
||
|
|||
25 | $image->setHeight($this->attributes['height']); |
||
26 | $image->setCrop(Ajde_Component_String::toBoolean($this->attributes['crop'])); |
||
27 | |||
28 | $controller = Ajde_Controller::fromRoute(new Ajde_Core_Route('_core/component:imageBase64')); |
||
29 | $controller->setImage($image); |
||
30 | $controller->setWidth(issetor($this->attributes['width'], null)); |
||
31 | $controller->setHeight(issetor($this->attributes['height'], null)); |
||
32 | $controller->setExtraClass(issetor($this->attributes['class'], '')); |
||
33 | |||
34 | return $controller->invoke(); |
||
35 | break; |
||
36 | } |
||
37 | // TODO: |
||
38 | throw new Ajde_Component_Exception('Missing required attributes for component call'); |
||
39 | } |
||
40 | } |
||
41 |
If you implement
__call
and 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
__call
is implemented by a parent class and only the child class knows which methods exist: