| Conditions | 5 |
| Paths | 12 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function __construct($options = []) |
||
| 28 | { |
||
| 29 | if(is_string($options)) |
||
| 30 | { |
||
| 31 | $this->title = $options; |
||
| 32 | $options = []; |
||
| 33 | } |
||
| 34 | $root = __DIR__; |
||
| 35 | if(empty($options['root'])) |
||
| 36 | { |
||
| 37 | $trace = debug_backtrace(null, 1); |
||
| 38 | $root = dirname($trace[0]['file']); |
||
| 39 | } |
||
| 40 | $defaults = [ |
||
| 41 | 'root' => $root, |
||
| 42 | 'path' => '.', |
||
| 43 | 'skipLevel' => 1 |
||
| 44 | ]; |
||
| 45 | foreach ($defaults as $name => $value) |
||
| 46 | { |
||
| 47 | if (!array_key_exists($name, $options)) |
||
| 48 | { |
||
| 49 | $options[$name] = $value; |
||
| 50 | } |
||
| 51 | } |
||
| 52 | parent::__construct($options); |
||
| 53 | } |
||
| 54 | |||
| 64 | } |