File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,18 +224,11 @@ public function visitProperty(PhpProperty $property) {
224224 }
225225
226226 protected function getPhpExport ($ value ) {
227- if (is_bool ($ value )) {
228- return $ value ? 'true ' : 'false ' ;
229- }
230-
227+ // Simply to be sure a null value is displayed in lowercase.
231228 if (null === $ value ) {
232229 return 'null ' ;
233230 }
234231
235- if (is_array ($ value )) {
236- return 'array() ' ;
237- }
238-
239232 return var_export ($ value , true );
240233 }
241234
Original file line number Diff line number Diff line change 33
44use gossi \codegen \model \PhpFunction ;
55use gossi \codegen \model \PhpParameter ;
6+ use gossi \codegen \model \PhpProperty ;
67use gossi \codegen \visitor \DefaultVisitor ;
78use gossi \codegen \model \PhpMethod ;
89use gossi \codegen \utils \Writer ;
@@ -52,6 +53,17 @@ public function testVisitMethodWithCallable() {
5253 $ this ->assertEquals ($ this ->getContent ('callable_parameter.php ' ), $ visitor ->getContent ());
5354 }
5455
56+ public function testDefaultNotEmptyArray () {
57+ $ property = new PhpProperty ('fooArray ' );
58+ $ visitor = new DefaultVisitor ();
59+
60+ $ property ->setDefaultValue (array ("some value " ));
61+ $ visitor ->visitProperty ($ property );
62+
63+ $ this ->assertContains ("some value " , $ visitor ->getContent ());
64+ }
65+
66+
5567 /**
5668 *
5769 * @param string $filename
You can’t perform that action at this time.
0 commit comments