| Conditions | 5 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | function __construct(array $argv, array $defaults = []) |
||
| 8 | { |
||
| 9 | $this->set('path', ROOT_DIR); |
||
| 10 | |||
| 11 | $self = $this; |
||
| 12 | array_walk($defaults, function($setting, $key) use ($self) { |
||
| 13 | $self->set( |
||
| 14 | $key, |
||
| 15 | $setting |
||
| 16 | ); |
||
| 17 | }); |
||
| 18 | |||
| 19 | foreach($argv as $arg) { |
||
| 20 | $e = explode('=', $arg); |
||
| 21 | if (count($e) === 2) { |
||
| 22 | $this->set($e[0], $e[1]); |
||
| 23 | } else { |
||
| 24 | $this->set($e[0], true); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | $this->set('generator', to_camel_case(@$argv[1] ?: '')); |
||
| 29 | $this->set('command', @$argv[2] ?: ''); |
||
| 30 | } |
||
| 67 |