public static function toComment(array $data) { $result = array(); foreach ($data as $key => $value) { $result[] = $key . ': ' . $value . ';'; } return implode(PHP_EOL, $result); }
public function testToComment() { $array = array('Name' => 'Denis ', 'Date' => 2015); is('Name: Denis ;' . PHP_EOL . 'Date: 2015;', Arr::toComment($array)); }