You are here

protected function Plugin::parse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Component/Annotation/Plugin.php \Drupal\Component\Annotation\Plugin::parse()

Parses an annotation into its definition.

Parameters

array $values: The annotation array.

Return value

array The parsed annotation as a definition.

1 call to Plugin::parse()
Plugin::__construct in core/lib/Drupal/Component/Annotation/Plugin.php
Constructs a Plugin object.

File

core/lib/Drupal/Component/Annotation/Plugin.php, line 59
Contains \Drupal\Component\Annotation\Plugin.

Class

Plugin
Defines a Plugin annotation object.

Namespace

Drupal\Component\Annotation

Code

protected function parse(array $values) {
  $definitions = array();
  foreach ($values as $key => $value) {
    if ($value instanceof AnnotationInterface) {
      $definitions[$key] = $value
        ->get();
    }
    elseif (is_array($value)) {
      $definitions[$key] = $this
        ->parse($value);
    }
    else {
      $definitions[$key] = $value;
    }
  }
  return $definitions;
}