Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Intellisense not working on "$this->app" on AppServiceProvider #142

Open
harryqt opened this issue Dec 30, 2024 · 0 comments
Open
Assignees
Labels

Comments

@harryqt
Copy link

harryqt commented Dec 30, 2024

Extension Version

0.1.14

PHP Binary

Local PHP

Operating System

macOS

What happened?

No intellisense is given for any of $this->app methods.

<?php

declare(strict_types=1);

namespace App\Providers;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        Model::shouldBeStrict(! $this->app->isProduction());
    }
}

When vscode-intelephense enabled, it throws Undefined method 'isProduction'.intelephense(P1013)

Workaround:

public function boot(): void
{
    /** @var \Illuminate\Foundation\Application $app */
    $app = $this->app;

    Model::shouldBeStrict(! $app->isProduction());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants