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

Breadcrumb

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

function CallCenter::createUnexpectedCallException

Parameters

ObjectProphecy<object> $prophecy:

string $methodName:

array<mixed> $arguments:

Return value

UnexpectedCallException

1 call to CallCenter::createUnexpectedCallException()
CallCenter::checkUnexpectedCalls in vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php

File

vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php, line 172

Class

CallCenter
Calls receiver & manager.

Namespace

Prophecy\Call

Code

private function createUnexpectedCallException(ObjectProphecy $prophecy, $methodName, array $arguments) {
    $classname = get_class($prophecy->reveal());
    $indentationLength = 8;
    // looks good
    $argstring = implode(",\n", $this->indentArguments(array_map(array(
        $this->util,
        'stringify',
    ), $arguments), $indentationLength));
    $expected = array();
    foreach (array_merge(...array_values($prophecy->getMethodProphecies())) as $methodProphecy) {
        $expected[] = sprintf("  - %s(\n" . "%s\n" . "    )", $methodProphecy->getMethodName(), implode(",\n", $this->indentArguments(array_map('strval', $methodProphecy->getArgumentsWildcard()
            ->getTokens()), $indentationLength)));
    }
    return new UnexpectedCallException(sprintf("Unexpected method call on %s:\n" . "  - %s(\n" . "%s\n" . "    )\n" . "expected calls were:\n" . "%s", $classname, $methodName, $argstring, implode("\n", $expected)), $prophecy, $methodName, $arguments);
}

API Navigation

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