Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Plugin.php

function 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 54

Class

Plugin
Defines a Plugin annotation object.

Namespace

Drupal\Component\Annotation

Code

protected function parse(array $values) {
    $definitions = [];
    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;
}
RSS feed
Powered by Drupal