You are here

PluginCollectionArrayAdapter.php in Extensible BBCode 8.3

Same filename and directory in other branches
  1. 4.0.x src/PluginCollectionArrayAdapter.php

Namespace

Drupal\xbbcode

File

src/PluginCollectionArrayAdapter.php
View source
<?php

namespace Drupal\xbbcode;


/**
 * Adapt plugin collection methods for array access.
 *
 * @package Drupal\xbbcode
 */
trait PluginCollectionArrayAdapter {

  /**
   * {@inheritdoc}
   */
  public function offsetExists($offset) : bool {

    /** @var \Drupal\xbbcode\PluginCollectionInterface $this */
    return $this
      ->has($offset);
  }

  /**
   * {@inheritdoc}
   */
  public function offsetGet($offset) {

    /** @var \Drupal\xbbcode\PluginCollectionInterface $this */
    return $this
      ->get($offset);
  }

  /**
   * {@inheritdoc}
   */
  public function offsetSet($offset, $value) {

    /** @var \Drupal\xbbcode\PluginCollectionInterface $this */
    return $this
      ->set($offset, $value);
  }

  /**
   * {@inheritdoc}
   */
  public function offsetUnset($offset) {

    /** @var \Drupal\xbbcode\PluginCollectionInterface $this */
    return $this
      ->remove($offset);
  }

}

Traits

Namesort descending Description
PluginCollectionArrayAdapter Adapt plugin collection methods for array access.