/** * Returns `data` from the response. * * @return array|Collection */ public function get() { if (empty($this->itemEnvelope)) { return $this->isCollection($this->data) ? new Collection($this->data) : $this->data; } $className = $this->itemEnvelope; $client = Container::get()->get(AdapterInterface::class); if ($this->isCollection($this->data)) { return new Collection(array_map(function ($item) use($className, $client) { return (new $className($client))->configure($item); }, $this->data)); } return (new $className($client))->configure($this->data); }
/** * @return \League\Container\Container $container */ public function getContainer() { return \Cleantekker\Container::get(); }