@@ 63-75 (lines=13) @@ | ||
60 | * @return string |
|
61 | * @throws \InvalidArgumentException |
|
62 | */ |
|
63 | public function formatListMarker(array $list): string |
|
64 | { |
|
65 | if (empty($list)) { |
|
66 | throw new \InvalidArgumentException('The list must contain at least one value'); |
|
67 | } |
|
68 | ||
69 | $output = "\n"; |
|
70 | foreach ($list as $value) { |
|
71 | $output .= "• " . $value . "\n"; |
|
72 | } |
|
73 | ||
74 | return $output; |
|
75 | } |
|
76 | ||
77 | /** |
|
78 | * @param array $list |
|
@@ 82-95 (lines=14) @@ | ||
79 | * @return string |
|
80 | * @throws \InvalidArgumentException |
|
81 | */ |
|
82 | public function formatListNumeric(array $list): string |
|
83 | { |
|
84 | if (empty($list)) { |
|
85 | throw new \InvalidArgumentException('The list must contain at least one value'); |
|
86 | } |
|
87 | ||
88 | $n = 0; |
|
89 | $output = "\n"; |
|
90 | foreach ($list as $value) { |
|
91 | $output .= ++$n . ". " . $value . "\n"; |
|
92 | } |
|
93 | ||
94 | return $output; |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * @param array $lines |