Larastan: Lumen 5.6 undefined method boot

Created on 2 Oct 2019  路  2Comments  路  Source: nunomaduro/larastan

  • Larastan Version: 0.4.0
  • --level used: default

Description

php artisan code:analyses

returns
Call to undefined method Laravel\Lumen\Application::boot()

Steps to reproduce

Install lumen 5.6

php composer create-project --prefer-dist laravel/lumen:v5.6.0 lumen5.6

Install larastan latest

php composer require --dev nunomaduro/larastan

Update bootstrap/app.php uncomment line 80

$app->register(App\Providers\AppServiceProvider::class);

Update AppServiceProvider register method

public function register()
{
    $this->app->register(\NunoMaduro\Larastan\LarastanServiceProvider::class);
    $this->app->instance('path.storage', app()->basePath().DIRECTORY_SEPARATOR.'storage');
    $this->app->instance('path.config', app()->basePath().DIRECTORY_SEPARATOR.'config');
}

Laravel code where the issue was found

On vendor/nunomaduro/larastan/bootstrap.php line 29
if we comment the $app->boot() line the command works

if ($app instanceof \Illuminate\Contracts\Foundation\Application) {
    $app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
} elseif ($app instanceof \Laravel\Lumen\Application) {
    $app->boot();
}

Am i missing something?
I think the boot method was never actually working (lumen v5.1) on Laravel\Lumen\Application now days it is not even present.

Cheers!

help wanted

Most helpful comment

No. Just drop Lumen 5.6 and bump illuminate components to min 5.7.

All 2 comments

boot method was added to \Laravel\Lumen\Application at version 5.7.0 So it's normal to have this error at 5.6.0

I'm not sure if we want to support Lumen 5.6 @nunomaduro what do you think? Should we support Lumen 5.6 ?

No. Just drop Lumen 5.6 and bump illuminate components to min 5.7.

Was this page helpful?
0 / 5 - 0 ratings