| Conditions | 5 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5.5069 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 1 | public function hashToFieldValue($fieldValue, array $context = array()) |
|
| 22 | { |
||
| 23 | 1 | $authors = array(); |
|
| 24 | |||
| 25 | /// @deprecated |
||
| 26 | 1 | if (isset($fieldValue['authors'])) { |
|
| 27 | foreach ($fieldValue['authors'] as $author) { |
||
| 28 | $author = $this->referenceResolver->resolveReference($author); |
||
| 29 | $authors[] = new Author($author); |
||
| 30 | } |
||
| 31 | 1 | } else if (is_array($fieldValue)) { |
|
| 32 | /// same as what fromHash() does, really |
||
| 33 | 1 | foreach ($fieldValue as $author) { |
|
| 34 | 1 | $author = $this->referenceResolver->resolveReference($author); |
|
| 35 | 1 | $authors[] = new Author($author); |
|
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | 1 | return new AuthorValue($authors); |
|
| 40 | } |
||
| 42 |