<?php
class Test
{
public function test(): static
{
return tap($this)->save();
}
public function save(): bool
{
return true;
}
}
This is giving me the error:
Expected type 'static'. Found 'bool'. (intelephense P1006)
I've tried adding the /** @disregard P1006 */ and it is not working.
/** @disregard P1006 */
public function test(): static
To Reproduce
Simply create a new file Test.php in a Laravel application with the following content:
<?php
class Test
{
/** @disregard P1006 */
public function test(): static
{
return tap($this)->save();
}
public function save(): bool
{
return true;
}
}
Expected behavior
Intelephense should not be flagging the return type error.
Screenshots
Platform and version
I'm on Apple M2 Pro with PHP v8.2.16 and Intelephense v1.10.4.
Describe the bug
I'm not able to suppress the P1006 error even though I've followed the instructions from https://github.com/bmewburn/vscode-intelephense/issues/568#issuecomment-1763662245.
This is giving me the error:
I've tried adding the
/** @disregard P1006 */
and it is not working.To Reproduce
Simply create a new file
Test.php
in a Laravel application with the following content:Expected behavior
Intelephense should not be flagging the return type error.
Screenshots
Platform and version
I'm on Apple M2 Pro with PHP v8.2.16 and Intelephense v1.10.4.