34 public function create( array $data,
$header =
'Automatically generated' ) {
36 .
"// " . implode(
"\n// ", explode(
"\n",
$header ) ) .
"\n"
38 foreach ( $data as $key => $value ) {
39 $code .= $this->encode( $key, $value, 1 );
54 private function encode( $key, $value, $indent ) {
55 $tabs = str_repeat(
"\t", $indent );
57 var_export( $key,
true ) .
59 if ( is_array( $value ) ) {
61 foreach ( $value as $key2 => $value2 ) {
62 $line .= $this->encode( $key2, $value2, $indent + 1 );
66 $line .= var_export( $value,
true );