File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -189,11 +189,16 @@ protected function linesFromPhpFile($file)
189189
190190 protected function getDotted ($ key , $ lang )
191191 {
192- return \Illuminate \Support \Arr::dot (
193- \Illuminate \Support \Arr::wrap (
194- __ ($ key , [], $ lang ),
195- ),
196- );
192+ try {
193+ return \Illuminate \Support \Arr::dot (
194+ \Illuminate \Support \Arr::wrap (
195+ __ ($ key , [], $ lang ),
196+ ),
197+ );
198+ } catch (\Throwable $ e ) {
199+ // Most likely, in this case, the lang file doesn't return an array
200+ return [];
201+ }
197202 }
198203
199204 protected function getPathIndex ($ file )
Original file line number Diff line number Diff line change @@ -189,11 +189,16 @@ $translator = new class
189189
190190 protected function getDotted($key, $lang)
191191 {
192- return \\Illuminate\\Support\\Arr::dot(
193- \\Illuminate\\Support\\Arr::wrap(
194- __($key, [], $lang),
195- ),
196- );
192+ try {
193+ return \\Illuminate\\Support\\Arr::dot(
194+ \\Illuminate\\Support\\Arr::wrap(
195+ __($key, [], $lang),
196+ ),
197+ );
198+ } catch (\\Throwable $e) {
199+ // Most likely, in this case, the lang file doesn't return an array
200+ return [];
201+ }
197202 }
198203
199204 protected function getPathIndex($file)
You can’t perform that action at this time.
0 commit comments