AbstractEnum::__call( string $name, WordPressAiClientCommonarray $arguments ): bool

In this article

Handles dynamic method calls for enum checking.

Parameters

$namestringrequired
The method name.
$arguments<span class="WordPressAiClientCommonarray”>WordPressAiClientCommonarrayrequired
The method arguments.

Return

bool True if the enum value matches.

Source

final public function __call(string $name, array $arguments): bool
{
    // Handle is* methods
    if (str_starts_with($name, 'is')) {
        $constantName = self::camelCaseToConstant(substr($name, 2));
        $constants = static::getConstants();
        if (isset($constants[$constantName])) {
            return $this->value === $constants[$constantName];
        }
    }
    throw new BadMethodCallException(sprintf('Method %s::%s does not exist', static::class, $name));
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.