Welcome Guest, Not a member yet? Register   Sign In
Visual Studio Code - Intelphense vs Intellisense

(This post was last modified: 09-02-2021, 07:24 AM by paulbalandan.)

1. For the service(), it has a documented return type of mixed so intelephense/intellisense cannot intelligently guess what specific object you are creating when you use that. I see 2 alternatives for that:

a. Inline annotate the variable $email
PHP Code:
/** var \CodeIgniter\Email\Email $email */
$email service('email'); 

b. Use the Services class to get specific documentation.
PHP Code:
use Config\Services;

$email Services::email(); 

2. For the Model/Builder, there exists a "@mixin" relationship for the two. The Model has a __call method that delegates unknown method calls to the Builder if the Builder has those methods defined. That's why you can call where(), a Builder method, in the context of a Model. Unfortunately, there's no straightforward way to make the 2 extensions understand this relationship. Support for this may be complex for them. What I can see as a possible solution (although not 100% spot on solution) is to use the "@method" annotation in the class docblock of Model. But as I said that solution is a patch not a cure.

I'm using VS Code so I am aware of these concerns. Smile

Messages In This Thread
RE: Visual Studio Code - Intelphense vs Intellisense - by paulbalandan - 09-02-2021, 07:21 AM

Theme © iAndrew 2016 - Forum software by © MyBB