Skip to content
Snippets Groups Projects
Commit e2ae6f71 authored by Jennifer Hodgdon's avatar Jennifer Hodgdon
Browse files

Issue #213887 by Xano: Fix up PluginBag documentation

parent 48f15583
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
/** /**
* Defines an object which stores multiple plugin instances to lazy load them. * Defines an object which stores multiple plugin instances to lazy load them.
*
* The \ArrayAccess implementation is only for backwards compatibility, it is
* deprecated and should not be used by new code.
*/ */
abstract class PluginBag implements \Iterator, \Countable { abstract class PluginBag implements \Iterator, \Countable {
...@@ -30,7 +27,7 @@ abstract class PluginBag implements \Iterator, \Countable { ...@@ -30,7 +27,7 @@ abstract class PluginBag implements \Iterator, \Countable {
protected $instanceIDs = array(); protected $instanceIDs = array();
/** /**
* Initializes a plugin and stores the result in $this->pluginInstances. * Initializes and stores a plugin.
* *
* @param string $instance_id * @param string $instance_id
* The ID of the plugin instance to initialize. * The ID of the plugin instance to initialize.
...@@ -85,7 +82,7 @@ public function set($instance_id, $value) { ...@@ -85,7 +82,7 @@ public function set($instance_id, $value) {
/** /**
* Removes an initialized plugin. * Removes an initialized plugin.
* *
* The plugin can still be used, it will be reinitialized. * The plugin can still be used; it will be reinitialized.
* *
* @param string $instance_id * @param string $instance_id
* The ID of the plugin instance to remove. * The ID of the plugin instance to remove.
...@@ -95,7 +92,7 @@ public function remove($instance_id) { ...@@ -95,7 +92,7 @@ public function remove($instance_id) {
} }
/** /**
* Adds an instance ID to the array of available instance IDs. * Adds an instance ID to the available instance IDs.
* *
* @param string $id * @param string $id
* The ID of the plugin instance to add. * The ID of the plugin instance to add.
...@@ -117,7 +114,7 @@ public function getInstanceIds() { ...@@ -117,7 +114,7 @@ public function getInstanceIds() {
} }
/** /**
* Sets the instance IDs property. * Sets all instance IDs.
* *
* @param array $instance_ids * @param array $instance_ids
* An associative array of instance IDs. * An associative array of instance IDs.
...@@ -138,28 +135,28 @@ public function removeInstanceId($instance_id) { ...@@ -138,28 +135,28 @@ public function removeInstanceId($instance_id) {
} }
/** /**
* Implements \Iterator::current(). * {@inheritdoc}
*/ */
public function current() { public function current() {
return $this->get($this->key()); return $this->get($this->key());
} }
/** /**
* Implements \Iterator::next(). * {@inheritdoc}
*/ */
public function next() { public function next() {
next($this->instanceIDs); next($this->instanceIDs);
} }
/** /**
* Implements \Iterator::key(). * {@inheritdoc}
*/ */
public function key() { public function key() {
return key($this->instanceIDs); return key($this->instanceIDs);
} }
/** /**
* Implements \Iterator::valid(). * {@inheritdoc}
*/ */
public function valid() { public function valid() {
$key = key($this->instanceIDs); $key = key($this->instanceIDs);
...@@ -167,14 +164,14 @@ public function valid() { ...@@ -167,14 +164,14 @@ public function valid() {
} }
/** /**
* Implements \Iterator::rewind(). * {@inheritdoc}
*/ */
public function rewind() { public function rewind() {
reset($this->instanceIDs); reset($this->instanceIDs);
} }
/** /**
* Implements \Countable::count(). * {@inheritdoc}
*/ */
public function count() { public function count() {
return count($this->instanceIDs); return count($this->instanceIDs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment