| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public static function toString(array $relations): string |
||
| 33 | { |
||
| 34 | $rrs = []; |
||
| 35 | foreach ($relations as $item) { |
||
| 36 | $id = (string)Hash::get($item, 'id'); |
||
| 37 | $type = (string)Hash::get($item, 'type'); |
||
| 38 | $meta = json_encode((array)Hash::get($item, 'meta.relation', [])); |
||
| 39 | $rrs[] = sprintf( |
||
| 40 | '%s-%s-%s', |
||
| 41 | $id, |
||
| 42 | $type, |
||
| 43 | $meta |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | |||
| 47 | return implode(',', $rrs); |
||
| 48 | } |
||
| 50 |