File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -224,18 +224,11 @@ public function visitProperty(PhpProperty $property) {
224224}
225225
226226protected  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. 
231228if  (null  === $ value ) {
232229return  'null ' ;
233230}
234231
235- if  (is_array ($ value )) {
236- return  'array() ' ;
237- }
238- 
239232return  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