matcher = $matcher; $this->response = $response; $this->throwable = $throwable; $this->maxHits = $maxHits; $this->hits = 0; } /** * @inheritDoc */ public function registerHit(): MockInterface { ++$this->hits; return $this; } /** * @inheritDoc */ public function available(): bool { return $this->hits < $this->maxHits; } /** * @inheritDoc */ public function getMatcher(): RequestMatcherInterface { return $this->matcher; } /** * @inheritDoc */ public function getResponse(): ?ResponseInterface { if ( null !== $this->response && null !== $this->response->getBody() && $this->response->getBody()->isSeekable() ) { $this->response->getBody()->seek(0); } return $this->response; } /** * @inheritDoc */ public function getThrowable(): ?Throwable { return $this->throwable; } }