Make createLocalViewFactory compatible with Laravel 8 (#1026)

* Make createLocalViewFactory compatible with Laravel 8

Fixes https://github.com/barryvdh/laravel-ide-helper/issues/1024

* tests: move up mockFilesystem so it get be re-used in other tests

Note: removed `$this->mockOutput = '';` as it was a no-op, that property
doesn't exist (it was probably a typo, but I guess we don't need it
anyway)

* tests: show basic features for ide-helper:meta working
This commit is contained in:
Markus Podar
2020-08-31 06:20:02 +02:00
committed by GitHub
parent 462989abd5
commit 1ca875fbca
4 changed files with 87 additions and 32 deletions
+6 -1
View File
@@ -15,6 +15,7 @@ use Barryvdh\LaravelIdeHelper\Console\EloquentCommand;
use Barryvdh\LaravelIdeHelper\Console\GeneratorCommand;
use Barryvdh\LaravelIdeHelper\Console\MetaCommand;
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Engines\EngineResolver;
use Illuminate\View\Engines\PhpEngine;
@@ -116,7 +117,11 @@ class IdeHelperServiceProvider extends ServiceProvider
{
$resolver = new EngineResolver();
$resolver->register('php', function () {
return new PhpEngine();
if ((int) Application::VERSION < 8) {
return new PhpEngine();
}
return new PhpEngine($this->app['files']);
});
$finder = new FileViewFinder($this->app['files'], [__DIR__ . '/../resources/views']);
$factory = new Factory($resolver, $finder, $this->app['events']);