| Conditions | 4 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 12 | public function __construct(schema $schema, array $defaults) |
|
| 23 | { |
||
| 24 | 12 | $this->schema = $schema; |
|
| 25 | |||
| 26 | 12 | foreach ($this->schema->get('fields') as $name => $config) { |
|
| 27 | 10 | if (array_key_exists($name, $defaults)) { |
|
| 28 | 7 | $config['default'] = $defaults[$name]; |
|
| 29 | } |
||
| 30 | 10 | $config['name'] = $name; |
|
| 31 | 10 | $this->fields[$name] = new transientnode($config); |
|
| 32 | 10 | if (isset($config['default'])) { |
|
| 33 | 10 | $this->fields[$name]->set_value($config['default']); |
|
| 34 | } |
||
| 67 |