Questions tagged [intelephense]

This tag should be used to discuss the PHP static code analysis and language tools provided by the Intelephense vscode plugin, including questions related to improving its effectiveness or correcting issues related to its installation, configuration, or potential bugs and shortcomings.

Intelephense is a high performance PHP language server packed full of essential features for productive PHP development. It provides PHP code intelligence for the Visual Studio Code editor.

78 questions
1
vote
1 answer

Tell intelephense that the function is valid

Consider the following class structures: trait MyTrait { public function definedFunction() { } } interface MyInterface { } class A { public function test() { if ($this instanceof MyInterface) { // my…
Adam Baranyai
  • 3,635
  • 3
  • 29
  • 68
0
votes
0 answers

How to fix code completion using DocBlock type hints with Intelephense?

I'm trying to get better completion with the VSCode extension Intelephense and some things aren't making sense. To start here is some example code:
JSP
  • 547
  • 1
  • 4
  • 18
0
votes
2 answers

Intelephense cannot find a certain class in App/Helpers

I have created a class in App\Helpers\IdTransformer theres just two functions there. I have registered it in aliases array in my app.php in config\app 'aliases' => Facade::defaultAliases()->merge([ // 'Example' =>…
0
votes
1 answer

Laravel 10 helper functions VS code intelephense issues

I recently updated my laravel project from 9.x to 10.x. Ever since the PHP intelephense extension in VS code is not able to find the global helper functions like view(), app(), resolve(), ... . They get marked down as with for example Undefined…
SenneVP
  • 35
  • 5
0
votes
1 answer

Undefined property '$M_Auth'.intelephense(1014) on Codeigniter 4

I'm going to make login page, but it keep telling me Undefined property '$M_Auth' when I'm trying to define my model, it's work well in my last project, but now when I open the last project this message is also occurred. This is my Auth…
Arsya
  • 7
  • 2
0
votes
0 answers

VSCODE Extension for PHP 5

I am working on an old project which is based on PHP5. I am using PHP intelephense as the VsCode extesnion but it showing me error lines in all the mysql functions because of mysqli funtions. Can anyone suggest me a good PHP extension for PHP5 or…
0
votes
0 answers

How to identify incorrect use of sizeof in PHP 7.4+?

We have a project created in CodeIgniter that was started with PHP 5.6, then migrated to PHP 7.0 and now we are migrating to PHP 8. However, our code has several places that use the sizeof function to find out if the Model functions are returning an…
Tom
  • 641
  • 2
  • 8
  • 21
0
votes
0 answers

why shouldReceive method not recognize in Laravel unit test?

I need to test unit my service in Laravel app. When i writing this code:
MISIU
  • 19
  • 5
0
votes
0 answers

Php formatter not working on remote files

I'm using macOS Ventura, with PHP Intelephense installed, option + shift + f on remote files says "There is no formatter for 'php' files installed." On local files, everything is fine. Why would that be?
0
votes
1 answer

Expected type 'bool'. Found 'Illuminate\Auth\Access\Response'.intelephense(1006)

I am working on a Laravel 10 on Visual Studio Code with intelephense extension installed. I am getting error on my policy classes saying, "Expected type 'bool'. Found 'Illuminate\Auth\Access\Response'.intelephense(1006)" Here is a portion of my…
Ayenew Yihune
  • 1,059
  • 13
  • 19
0
votes
1 answer

Laravel 9: Undefined type 'Illuminate\Support\Facades\Route'. Intelephense 1009

Can anyone help me? I'm still a beginner in Laravel. So, this error appeared when I just did a git clone project. After that I opened the project with vsCode and immediately got lots of errors. Error : Undefined type…
0
votes
1 answer

Some PHP Function Flagged as Error in VSCode

I am a beginner and am developing a specific web system using PHP 8.2, Codeigniter 4 and XAMPP in VSCode. However, in my Controller, some PHP functions are marked as errors, such as password_verify(), strpos() etc. After I run it, the program runs…
0
votes
0 answers

Why does Intelephense dislike my custom helper class?

I am trying to write some custom helper functions for my Laravel 9 app using the advice given in the second answer (written by heisian) to this question. I think I've imitated everything faithfully but when I try to use the new function,…
Henry
  • 1,395
  • 1
  • 12
  • 31
0
votes
0 answers

Undefined type 'Request'.intelephense(1009) in /Request::cookie

I have just cloned my laravel project from github to work from another computer and when in vscode i get in the controller it appears this error: "Undefined type 'Request'.intelephense(1009)" In this line of code: "$cookie_leida =…
0
votes
1 answer

intelephense undefined constant/ vscode

code completion doesn't work (vscode on mac) when php open/ closing tags are on one line. code completion works when three lines are used. please see screenshot. how could this be resolved? php code completion cheers PJ