error = $error; } else { throw new \InvalidArgumentException( "Throwable Exception instance required" ); } } /** * {@inheritdoc} * * NOTE: because this object represents a resolved Promise it will *always* invoke * the specified $cb callback immediately. */ public function when(callable $cb, $cbData = null) { \call_user_func($cb, $this->error, $result = null, $cbData); return $this; } /** * {@inheritdoc} * * Does nothing; a resolved promise has no progress updates */ public function watch(callable $cb, $cbData = null) { return $this; } }