You are here

protected static function AnnotationNormalizer::getAnnotationType in JSON-RPC 2.x

Same name and namespace in other branches
  1. 8 modules/jsonrpc_discovery/src/Normalizer/AnnotationNormalizer.php \Drupal\jsonrpc_discovery\Normalizer\AnnotationNormalizer::getAnnotationType()

Extract the annotation type.

Parameters

mixed $annotation: The annotated object.

Return value

string The type.

1 call to AnnotationNormalizer::getAnnotationType()
AnnotationNormalizer::normalize in modules/jsonrpc_discovery/src/Normalizer/AnnotationNormalizer.php

File

modules/jsonrpc_discovery/src/Normalizer/AnnotationNormalizer.php, line 94

Class

AnnotationNormalizer
The normalizer class for annotated objects.

Namespace

Drupal\jsonrpc_discovery\Normalizer

Code

protected static function getAnnotationType($annotation) {
  switch (get_class($annotation)) {
    case JsonRpcMethod::class:
      return 'JsonRpcMethod';
    case JsonRpcParameterDefinition::class:
      return 'JsonRpcParameterDefinition';
    default:
      return get_class($annotation);
  }
}