You are here

trait PluginCollectionArrayAdapter in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x src/PluginCollectionArrayAdapter.php \Drupal\xbbcode\PluginCollectionArrayAdapter

Adapt plugin collection methods for array access.

@package Drupal\xbbcode

Hierarchy

File

src/PluginCollectionArrayAdapter.php, line 10

Namespace

Drupal\xbbcode
View source
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);
  }

}

Members