Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
e2ae6f71
Commit
e2ae6f71
authored
11 years ago
by
Jennifer Hodgdon
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#213887
by Xano: Fix up PluginBag documentation
parent
48f15583
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Component/Plugin/PluginBag.php
+10
-13
10 additions, 13 deletions
core/lib/Drupal/Component/Plugin/PluginBag.php
with
10 additions
and
13 deletions
core/lib/Drupal/Component/Plugin/PluginBag.php
+
10
−
13
View file @
e2ae6f71
...
...
@@ -9,9 +9,6 @@
/**
* 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
{
...
...
@@ -30,7 +27,7 @@ abstract class PluginBag implements \Iterator, \Countable {
protected
$instanceIDs
=
array
();
/**
* Initializes
a plugin
and stores
the result in $this->pluginInstances
.
* Initializes and stores
a plugin
.
*
* @param string $instance_id
* The ID of the plugin instance to initialize.
...
...
@@ -85,7 +82,7 @@ public function set($instance_id, $value) {
/**
* 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
* The ID of the plugin instance to remove.
...
...
@@ -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
* The ID of the plugin instance to add.
...
...
@@ -117,7 +114,7 @@ public function getInstanceIds() {
}
/**
* Sets
the
instance IDs
property
.
* Sets
all
instance IDs.
*
* @param array $instance_ids
* An associative array of instance IDs.
...
...
@@ -138,28 +135,28 @@ public function removeInstanceId($instance_id) {
}
/**
*
Implements \Iterator::current().
*
{@inheritdoc}
*/
public
function
current
()
{
return
$this
->
get
(
$this
->
key
());
}
/**
*
Implements \Iterator::next().
*
{@inheritdoc}
*/
public
function
next
()
{
next
(
$this
->
instanceIDs
);
}
/**
*
Implements \Iterator::key().
*
{@inheritdoc}
*/
public
function
key
()
{
return
key
(
$this
->
instanceIDs
);
}
/**
*
Implements \Iterator::valid().
*
{@inheritdoc}
*/
public
function
valid
()
{
$key
=
key
(
$this
->
instanceIDs
);
...
...
@@ -167,14 +164,14 @@ public function valid() {
}
/**
*
Implements \Iterator::rewind().
*
{@inheritdoc}
*/
public
function
rewind
()
{
reset
(
$this
->
instanceIDs
);
}
/**
*
Implements \Countable::count().
*
{@inheritdoc}
*/
public
function
count
()
{
return
count
(
$this
->
instanceIDs
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment