| Total Complexity | 10 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 77.27% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class nullcontainer extends container |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * |
||
| 18 | * @var mixed |
||
| 19 | */ |
||
| 20 | protected $value; |
||
| 21 | |||
| 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 | } |
||
| 35 | } |
||
| 36 | 12 | } |
|
| 37 | |||
| 38 | 11 | public function lock() : bool |
|
| 39 | { |
||
| 40 | 11 | return true; |
|
| 41 | } |
||
| 42 | |||
| 43 | 3 | public function unlock() : bool |
|
| 44 | { |
||
| 45 | 3 | return true; |
|
| 46 | } |
||
| 47 | |||
| 48 | 11 | public function is_locked() : bool |
|
| 49 | { |
||
| 50 | 11 | return false; |
|
| 51 | } |
||
| 52 | |||
| 53 | public function set_value($value) |
||
| 54 | { |
||
| 55 | $this->value = $value; |
||
| 56 | } |
||
| 57 | |||
| 58 | public function get_value() |
||
| 61 | } |
||
| 62 | |||
| 63 | 2 | public function save() |
|
| 64 | { |
||
| 65 | 2 | } |
|
| 66 | } |
||
| 67 |