2 namespace Consolidation\OutputFormatters\Transformations;
5 * Transform a string of properties into a PHP associative array.
23 public static function parse($data)
25 if (!is_string($data)) {
29 $lines = explode("\n", $data);
30 foreach ($lines as $line) {
31 list($key, $value) = explode(':', trim($line), 2) + ['', ''];
32 if (!empty($key) && !empty($value)) {
33 $result[$key] = trim($value);