You are here

public function TestPluginTrait::__call in Search API 8

Implements the magic __call() method.

Allows the easy definition of additional methods via method overrides.

Parameters

string $name: The method name.

array $arguments: The arguments of the method call.

Return value

mixed The method's return value, if any.

See also

\Drupal\search_api_test\TestPluginTrait::getMethodOverride()

File

tests/search_api_test/src/TestPluginTrait.php, line 124

Class

TestPluginTrait
Provides common functionality for test plugins.

Namespace

Drupal\search_api_test

Code

public function __call($name, array $arguments) {
  if ($override = $this
    ->getMethodOverride($name)) {
    array_unshift($arguments, $this);
    return call_user_func_array($override, $arguments);
  }
  $class = static::class;
  throw new \BadMethodCallException("Method {$class}::{$name}() doesn't exist.");
}