Skip to content

Commit ac223b4

Browse files
chrisolofpaul-m
chrisolof
authored andcommitted
Issue #2931559 by chrisolof: $sandwich_plugin_info should be passed by reference
1 parent 402390d commit ac223b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugin_type_example/plugin_type_example.api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @param array $sandwich_plugin_info
1717
* This is the array of plugin definitions.
1818
*/
19-
function hook_sandwich_info_alter(array $sandwich_plugin_info) {
19+
function hook_sandwich_info_alter(array &$sandwich_plugin_info) {
2020
// Let's change the 'foobar' property for all sandwiches.
2121
foreach ($sandwich_plugin_info as $plugin_id => $plugin_definition) {
2222
$sandwich_plugin_info[$plugin_id]['foobar'] = t('We have altered this in the alter hook');

plugin_type_example/tests/src/Functional/PluginTypeExampleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PluginTypeExampleTest extends ExamplesBrowserTestBase {
3232
/**
3333
* Test the plugin manager can be loaded, and the plugins are registered.
3434
*
35-
* @todo: Check the alter hook fired and changed a property.
35+
* @todo: https://www.drupal.org/project/examples/issues/2985705
3636
*/
3737
public function testPluginExample() {
3838
/* @var $manager \Drupal\plugin_type_example\SandwichPluginManager */

0 commit comments

Comments
 (0)