You are here

public function MethodProphecy::withArguments in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php \Prophecy\Prophecy\MethodProphecy::withArguments()

Sets argument wildcard.

Parameters

array|Argument\ArgumentsWildcard $arguments:

Return value

$this

Throws

\Prophecy\Exception\InvalidArgumentException

1 call to MethodProphecy::withArguments()
MethodProphecy::__construct in vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php
Initializes method prophecy.

File

vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php, line 109

Class

MethodProphecy
Method prophecy.

Namespace

Prophecy\Prophecy

Code

public function withArguments($arguments) {
  if (is_array($arguments)) {
    $arguments = new Argument\ArgumentsWildcard($arguments);
  }
  if (!$arguments instanceof Argument\ArgumentsWildcard) {
    throw new InvalidArgumentException(sprintf("Either an array or an instance of ArgumentsWildcard expected as\n" . 'a `MethodProphecy::withArguments()` argument, but got %s.', gettype($arguments)));
  }
  $this->argumentsWildcard = $arguments;
  return $this;
}