does not recognise that OAuth2GrantType::* is compatible with string
incorrectly reports the string&OAuth2GrantType::* received by processToken() (inferrable without reference to the constants in OAuth2GrantType) cannot be passed to a string&OAuth2GrantType::* parameter
The problem report is:
Expected type 'string'. Found 'OAuth2GrantType::*'.intelephense(P1006)
"Go to Definition" from OAuth2GrantType::* in PHPDoc type locations would also be nice to have, but the incorrect problem report is the main issue.
To Reproduce
<?php
class OAuth2GrantType
{
public const AUTHORIZATION_CODE = 'authorization_code';
public const REFRESH_TOKEN = 'refresh_token';
public const CLIENT_CREDENTIALS = 'client_credentials';
}
abstract class OAuth2Client
{
/**
* @param OAuth2GrantType::* $grantType
*/
abstract function receiveToken(string $token, string $grantType): void;
/**
* @param OAuth2GrantType::* $grantType
*/
public function processToken(string $token, string $grantType): void
{
// "Expected type 'string'. Found 'OAuth2GrantType::*'.intelephense(P1006)"
$this->receiveToken($token, $grantType);
}
}
Describe the bug
In the code below, Intelephense:
OAuth2GrantType::*
is compatible withstring
string&OAuth2GrantType::*
received byprocessToken()
(inferrable without reference to the constants inOAuth2GrantType
) cannot be passed to astring&OAuth2GrantType::*
parameterThe problem report is:
"Go to Definition" from
OAuth2GrantType::*
in PHPDoc type locations would also be nice to have, but the incorrect problem report is the main issue.To Reproduce
Platform and version
v1.10.2 on macOS and Linux