Skip to content

Commit

Permalink
#3120 removing self types on InvocationStubber: requires PHP 7.4
Browse files Browse the repository at this point in the history
Once we have PHP 7.4, we can move these type declarations into the interface
signature again, but for now, the existing inheritance leads to a crash
on PHP < 7.4.
  • Loading branch information
Ocramius authored and sebastianbergmann committed Sep 6, 2019
1 parent 9a1c97a commit 508f656
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions src/Framework/MockObject/Builder/InvocationStubber.php
Expand Up @@ -21,24 +21,47 @@ interface InvocationStubber
*/
public function will(Stub $stub): Identity;

public function willReturn($value, ...$nextValues): self;
/** @return self */
public function willReturn($value, ...$nextValues);

/** @param mixed $reference */
public function willReturnReference(&$reference): self;
/**
* @param mixed $reference
*
* @return self
*/
public function willReturnReference(&$reference);

/** @param array<int, array<int, mixed>> $valueMap */
public function willReturnMap(array $valueMap): self;
/**
* @param array<int, array<int, mixed>> $valueMap
*
* @return self
*/
public function willReturnMap(array $valueMap);

/** @param int $argumentIndex */
public function willReturnArgument($argumentIndex): self;
/**
* @param int $argumentIndex
*
* @return self
*/
public function willReturnArgument($argumentIndex);

/** @param callable $callback */
public function willReturnCallback($callback): self;
/**
* @param callable $callback
*
* @return self
*/
public function willReturnCallback($callback);

public function willReturnSelf(): self;
/** @return self */
public function willReturnSelf();

/** @param mixed $values */
public function willReturnOnConsecutiveCalls(...$values): self;
/**
* @param mixed $values
*
* @return self
*/
public function willReturnOnConsecutiveCalls(...$values);

public function willThrowException(\Throwable $exception): self;
/** @return self */
public function willThrowException(\Throwable $exception);
}

0 comments on commit 508f656

Please sign in to comment.