You are here

public static function AnnotationObject::create in Markdown 8.2

Allows the creation of new objects statically, for easier chainability.

Parameters

array|\Traversable $values: Optional. The initial values to populate the annotation with.

Return value

static

File

src/Annotation/AnnotationObject.php, line 130

Class

AnnotationObject
Base annotation class for retrieving the annotation as an object.

Namespace

Drupal\markdown\Annotation

Code

public static function create($values = []) {
  if ($values instanceof \Traversable) {
    $values = iterator_to_array($values);
  }
  return new static($values);
}