| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | static public function createHandler(\app\models\PropertyHandler $property_handler) |
||
| 16 | { |
||
| 17 | if (!isset(static::$handlers[$property_handler->id])) { |
||
| 18 | $handlerClass = $property_handler->handler_class_name; |
||
| 19 | |||
| 20 | if (is_subclass_of($handlerClass, '\app\properties\handlers\AbstractHandler')) { |
||
|
|
|||
| 21 | /** @var $handler \app\properties\handlers\AbstractHandler */ |
||
| 22 | $handler = new $handlerClass($property_handler); |
||
| 23 | static::$handlers[$property_handler->id] = $handler; |
||
| 24 | |||
| 25 | return $handler; |
||
| 26 | } |
||
| 27 | } elseif (isset(static::$handlers[$property_handler->id])) { |
||
| 28 | return static::$handlers[$property_handler->id]; |
||
| 29 | } |
||
| 30 | |||
| 31 | return static::$handlers[$property_handler->id] = new DummyHandler($property_handler); |
||
| 32 | } |
||
| 33 | |||
| 51 | ?> |