/** * Records the invocation of the method. * * @param array $arguments * @param mixed $returnValue * @param \Exception $thrown * @throws \ReflectionException */ public function record($arguments, $returnValue, \Exception $thrown = null) { $this->history->add(new Call($this->named($arguments), $returnValue, $thrown)); if (!$this->checkReturnType) { return; } if ($thrown) { $this->checkException($thrown); } else { $this->checkReturnValue($returnValue); } }