Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CallbackToken.php

function CallbackToken::__construct

Initializes token.

Parameters

callable $callback:

string|null $customStringRepresentation Customize the __toString() representation of this token:

Throws

\Prophecy\Exception\InvalidArgumentException

File

vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php, line 38

Class

CallbackToken
Callback-verified token.

Namespace

Prophecy\Argument\Token

Code

public function __construct($callback, ?string $customStringRepresentation = null) {
    if (!is_callable($callback)) {
        throw new InvalidArgumentException(sprintf('Callable expected as an argument to CallbackToken, but got %s.', gettype($callback)));
    }
    $this->callback = $callback;
    $this->customStringRepresentation = $customStringRepresentation;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal