Automattic\WooCommerce\Vendor\GraphQL\Type\Definition
PhpEnumType::deprecationReason
Method of the class: PhpEnumType{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->deprecationReason( $reflection ): ?string;
- $reflection(ReflectionClassConstant) (required)
- .
PhpEnumType::deprecationReason() PhpEnumType::deprecationReason code WC 10.9.4
protected function deprecationReason(\ReflectionClassConstant $reflection): ?string
{
$attributes = $reflection->getAttributes(Deprecated::class);
if (count($attributes) === 1) {
return $attributes[0]->newInstance()->reason;
}
if (count($attributes) > 1) {
throw new \Exception(self::MULTIPLE_DEPRECATIONS_DISALLOWED);
}
return null;
}