PluginTestHooks.php

Namespace

Drupal\plugin_test\Hook

File

core/modules/system/tests/modules/plugin_test/src/Hook/PluginTestHooks.php

View source
<?php

declare (strict_types=1);
namespace Drupal\plugin_test\Hook;

use Drupal\plugin_test\Plugin\plugin_test\fruit\Apple;
use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for plugin_test.
 */
class PluginTestHooks {
  
  /**
   * Implements hook_test_plugin_info().
   */
  public function testPluginInfo() : array {
    return [
      'apple' => [
        'id' => 'apple',
        'class' => Apple::class,
      ],
    ];
  }
  
  /**
   * Implements hook_plugin_test_alter().
   */
  public function pluginTestAlter(&$definitions) : void {
    foreach ($definitions as &$definition) {
      $definition['altered'] = TRUE;
    }
    $definitions['user_login']['altered_single'] = TRUE;
  }

}

Classes

Title Deprecated Summary
PluginTestHooks Hook implementations for plugin_test.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.