File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function sortNatural(): static
2121
2222 public function toDotTranslations (): Collection
2323 {
24- return $ this ->toBase ();
24+ return $ this ->toBase ()-> filter ()-> filter ( fn ( $ value ) => $ value !== [] && $ value !== null ) ;
2525 }
2626
2727 public function toTranslationsKeys (): Collection
Original file line number Diff line number Diff line change @@ -67,7 +67,10 @@ protected function recursiveSortNatural(array $items): array
6767
6868 public function toDotTranslations (): Collection
6969 {
70- return $ this ->dot ()->toBase ();
70+ /**
71+ * Filtering the array prevent incoherent values such as such as 'key' => []
72+ */
73+ return $ this ->dot ()->toBase ()->filter (fn ($ value ) => $ value !== [] && $ value !== null );
7174 }
7275
7376 public function toTranslationsKeys (): Collection
You can’t perform that action at this time.
0 commit comments