coding-socks / lost-in-translation

This package helps to find missing translation strings in your Laravel blade files.
MIT License
4 stars 1 forks source link

array_replace_recursive(): Argument #2 must be of type array, int given #3

Open kropcik opened 2 days ago

kropcik commented 2 days ago
  TypeError

  array_replace_recursive(): Argument #2 must be of type array, int given

  at vendor\laravel\framework\src\Illuminate\Translation\FileLoader.php:129
    125▕     {
    126▕         return collect($paths)
    127▕             ->reduce(function ($output, $path) use ($locale, $group) {
    128▕                 if ($this->files->exists($full = "{$path}/{$locale}/{$group}.php")) {
  ➜ 129▕                     $output = array_replace_recursive($output, $this->files->getRequire($full));
    130▕                 }
    131▕
    132▕                 return $output;
    133▕             }, []);

  1   vendor\laravel\framework\src\Illuminate\Translation\FileLoader.php:129

  2   vendor\laravel\framework\src\Illuminate\Collections\Traits\EnumeratesValues.php:791

When scannable locale does have a file but it's empty (not an array). If you are busy, I'll make pull request whenever I have time.

nerg4l commented 1 day ago

@kropcik Thank you for opening this issue. I will look into this and try to fix it as soon as possible.