/** * Initializes the spy. * * If no function is specified it will use the existing function. * * @param string $namespace The namespace for the mock function. * @param string $name The function name of the mocked function. * @param callable|null $function The mock function, or null for using the existing function. */ public function __construct($namespace, $name, callable $function = null) { parent::__construct($namespace, $name, $function ?: $name); }