| Conditions | 6 |
| Paths | 24 |
| Total Lines | 27 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 18.1218 |
| Changes | 4 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 27 | 6 | public function __construct($values) |
|
| 28 | { |
||
| 29 | 6 | if (isset($values['value'])) { |
|
| 30 | $this->name = "rest"; |
||
| 31 | $this->option = array( |
||
| 32 | "url" => $values['value'], |
||
| 33 | "format" => "json", |
||
| 34 | ); |
||
| 35 | $this->writer = array( |
||
| 36 | "type" => "json", |
||
| 37 | "writeRecordId" => false, |
||
| 38 | ); |
||
| 39 | } else { |
||
| 40 | 6 | if (isset($values['name'])) { |
|
| 41 | $this->name = $values['name']; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | 6 | if (isset($values['option'])) { |
|
| 45 | $this->option = array_merge($this->option, $values['option']); |
||
| 46 | } |
||
| 47 | 6 | if (isset($values['writer'])) { |
|
| 48 | $this->writer = array_merge($this->writer, $values['writer']); |
||
| 49 | } |
||
| 50 | 6 | if (isset($values['reader'])) { |
|
| 51 | $this->reader = $values['reader']; |
||
| 52 | } |
||
| 53 | } |
||
| 54 | } |