public function fetchFreshData($source, EncapsulatedOptions $options = null) { if ($options && !$options instanceof SoapOptions) { throw new \InvalidArgumentException('Options must be an instance of SoapOptions.'); } $params = array_merge($this->options->getParameters(), $options ? $options->getParameters() : []); return ObjectType::toArray(\ScriptFUSION\Retry\retry(5, function () use($source, $params) { return $this->getOrCreateClient()->{$source}($params); }, new ExponentialBackoffErrorHandler())); }
public function testToArray() { $object = json_decode(json_encode($array = ['foo' => ['bar']])); self::assertSame($array, ObjectType::toArray($object)); }