Inheritance: use trait ScriptFUSION\StaticClass
Example #1
0
 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()));
 }
Example #2
0
 public function testToArray()
 {
     $object = json_decode(json_encode($array = ['foo' => ['bar']]));
     self::assertSame($array, ObjectType::toArray($object));
 }