class RedisCommandMethodsExtension implements MethodsClassReflectionExtension

Resolves a Redis command written in another casing than its documented tag.

Redis connections lowercase a command's name before running it, so hexists(), hExists() and HEXISTS() are one command, but PHPStan matches @method tags by their exact name. Only RedisConnection's own command tags are matched this way; other magic names, such as macros, keep their exact case. The proxy and manager reach this through their mixins.

Methods

__construct(ReflectionProvider $reflectionProvider, RuntimeInputs $runtimeInputs)

Create a new extension instance.

bool
hasMethod(ClassReflection $classReflection, string $methodName)

Determine whether the method is a documented Redis command in another casing.

MethodReflection
getMethod(ClassReflection $classReflection, string $methodName)

Get the documented command's reflection, as the receiver resolves it.

Details

at line 43
__construct(ReflectionProvider $reflectionProvider, RuntimeInputs $runtimeInputs)

Create a new extension instance.

Parameters

ReflectionProvider $reflectionProvider
RuntimeInputs $runtimeInputs

at line 52
bool hasMethod(ClassReflection $classReflection, string $methodName)

Determine whether the method is a documented Redis command in another casing.

Parameters

ClassReflection $classReflection
string $methodName

Return Value

bool

at line 62
MethodReflection getMethod(ClassReflection $classReflection, string $methodName)

Get the documented command's reflection, as the receiver resolves it.

Parameters

ClassReflection $classReflection
string $methodName

Return Value

MethodReflection