themsaid / laravel-langman

Language files manager in your artisan console.
MIT License
876 stars 166 forks source link

ErrorException When Calling the Manager files() Function In Laravel 5.1 #33

Closed joshua55 closed 8 years ago

joshua55 commented 8 years ago

When I inject the Manager into a command I'm writing in our Laravel 5.1 based app so I can utilize its methods I am able to successfully do this: $allViewsKeys = $this->manager->collectFromFiles();

But when I try and do this: $translationFiles = $this->manager->files();

I get the error: [ErrorException]
Missing argument 2 for Themsaid\Langman\Manager::Themsaid\Langman{closure}()

But is seems all our system variables are in the places the module is expecting the find them.

themsaid commented 8 years ago

I think it has to do with Illuminate/Support 5.1 Collection::filter() implementation, in 5.1 it uses array filter that only pass the value to the callback, while in 5.2 it uses different implementation.

I guess I'll have to remove Illuminate/Support from the package and replace it with the standalone Collection library.

themsaid commented 8 years ago

This is fixed now, please confirm.

joshua55 commented 8 years ago

Confirmed. With the latest code I am able to successfully run $this->manager->files() without errors in our application. Thanks!