Fix "Using $this when not in object context" bug

This commit fixes the "Using $this when not in object context" bug for the Lumen configuration. Since the `bootstrap/app.php`-file is not in object context, and the `app` instance accessible using the `$app` variable directly, using `$this->app` will result in a fatal error.
This commit is contained in:
Karim Geiger
2016-09-05 23:24:04 +02:00
committed by GitHub
parent 2de6ab6038
commit abe2df5853
+2 -2
View File
@@ -200,8 +200,8 @@ You can install Laravel IDE Helper in `app/Providers/AppServiceProvider.php`, an
If you are not using that line, that is usually handy to manage gracefully multiple Laravel/Lumen installations, you will have to add this line of code under the `Register Service Providers` section of your `bootstrap/app.php`. If you are not using that line, that is usually handy to manage gracefully multiple Laravel/Lumen installations, you will have to add this line of code under the `Register Service Providers` section of your `bootstrap/app.php`.
```php ```php
if ($this->app->environment() !== 'production') { if ($app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); $app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
} }
``` ```