Conditions | 4 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
50 | public function transform( $names, bool $prefix = true ) : string |
||
51 | { |
||
52 | $names = array_merge( $prefix ? $this->names : [], (array) $names ); |
||
53 | |||
54 | if( ( $result = array_shift( $names ) ) === null ) { |
||
55 | return ''; |
||
56 | } |
||
57 | |||
58 | foreach( $names as $name ) { |
||
59 | $result .= '[' . $name . ']'; |
||
60 | } |
||
61 | |||
62 | return $result; |
||
63 | } |
||
65 |