| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 34 | 2 | public function getText() |
|
| 35 | { |
||
| 36 | 2 | $text = ''; |
|
| 37 | |||
| 38 | 2 | foreach ($this->xmlField->Data->Object as $object) { |
|
| 39 | // @codingStandardsIgnoreStart |
||
| 40 | 2 | if ($object->SrcField) { |
|
| 41 | // Field is a merge field, fetch text from source field |
||
| 42 | 1 | $sourceFieldName = (string) $object->SrcField->attributes()->SrcFieldName; |
|
| 43 | |||
| 44 | 1 | $sourceField = $this->getParserManager()->getParser($sourceFieldName); |
|
| 45 | |||
| 46 | 1 | $fieldText = $sourceField->getText(); |
|
| 47 | 1 | } else { |
|
| 48 | 2 | $fieldText = (string) $object->Default; |
|
| 49 | } |
||
| 50 | // @codingStandardsIgnoreEnd |
||
| 51 | |||
| 52 | 2 | $text .= $fieldText; |
|
| 53 | 2 | } |
|
| 54 | |||
| 55 | 2 | return $text; |
|
| 56 | } |
||
| 57 | } |
||
| 58 |