File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,10 @@ private function tableRows()
113113 continue ;
114114 }
115115
116- $ output [$ key ]['key ' ] = $ key ;
117- $ output [$ key ][$ languageKey ] = $ value ;
116+ if (count ($ value )) {
117+ $ output [$ key ]['key ' ] = $ key ;
118+ $ output [$ key ][$ languageKey ] = $ value ;
119+ }
118120 }
119121 }
120122
Original file line number Diff line number Diff line change @@ -128,4 +128,16 @@ public function testCommandOutputForKeyOnCloseMatch()
128128 $ this ->assertRegExp ('/username(?:.*)uname(?:.*)|(?: *)|/ ' , $ this ->consoleOutput ());
129129 $ this ->assertNotContains ('age ' , $ this ->consoleOutput ());
130130 }
131+
132+ public function test_ignore_attributes_and_keys_with_empty_arrays ()
133+ {
134+ $ this ->createTempFiles ([
135+ 'en ' => ['user ' => "<?php \n return ['name' => 'Name']; " ],
136+ 'nl ' => ['user ' => "<?php \n return ['name' => []]; " ],
137+ ]);
138+
139+ $ this ->artisan ('langman:show ' , ['key ' => 'user ' ]);
140+ $ this ->assertRegExp ('/key(?:.*)en(?:.*)nl/ ' , $ this ->consoleOutput ());
141+ $ this ->assertRegExp ('/name(?:.*)Name(?:.*)MISSING/ ' , $ this ->consoleOutput ());
142+ }
131143}
You can’t perform that action at this time.
0 commit comments