| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 1 | public function fromStr(string $representedParty): XmlInjectable |
|
| 22 | { |
||
| 23 | 1 | $fragment = ['<repr:representedParty xmlns:repr="http://x-road.eu/xsd/representation.xsd">']; |
|
| 24 | |||
| 25 | 1 | $parts = explode('/', $representedParty, 2); |
|
| 26 | |||
| 27 | 1 | if (count($parts) > 1) { |
|
| 28 | 1 | $fragment[] = '<repr:partyClass>' . $parts[0] . '</repr:partyClass>'; |
|
| 29 | 1 | array_shift($parts); |
|
| 30 | } |
||
| 31 | |||
| 32 | 1 | $fragment[] = '<repr:partyCode>' . $parts[0] . '</repr:partyCode>'; |
|
| 33 | 1 | $fragment[] = '</repr:representedParty>'; |
|
| 34 | |||
| 35 | 1 | return new FragmentInjection( |
|
| 36 | 1 | 'http://schemas.xmlsoap.org/soap/envelope/', |
|
| 37 | 1 | 'Header', |
|
| 38 | 1 | implode('', $fragment) |
|
| 39 | ); |
||
| 42 |