src/Query/FullScriptQuery.php
public function execute()
    {
        $url = sprintf('%s/%s?_format=json&access_token=%s',
            $this->apiUrl,
            $this->scriptUrl,
            $this->token
        );

        $response = $this->client->get($url);

        if (200 !== $response->getStatusCode()) {
            return;
        }

        $fullScriptFacade = json_decode($response->getBody(), true);
        $types = [
            'analytics' => 'Analytics',
            'message' => 'Message',
            'product' => 'Product',
            'banner' => 'AutopromoBanner',
            'iab_banner' => 'IabBanner',
        ];

        foreach ($types as $type => $element) {
            if (array_key_exists($type, $fullScriptFacade['script_codes'])) {
                $scriptSetter = 'set' . $element . 'Script';
                $codeSetter = 'set'. $element . 'Code';
                $this->cache->$scriptSetter($fullScriptFacade['script_codes'][$type]['script_name']);
                $this->cache->$codeSetter($fullScriptFacade['script_codes'][$type]['code']);
            } else {
                $clearer = 'clear' . $element . 'Data';
                $this->cache->$clearer();
            }
        }
    }
public function execute()
    {
        $url = sprintf('%s/%s?_format=json&access_token=%s',
            $this->apiUrl,
            $this->scriptUrl,
            $this->token
        );

        $response = $this->client->get($url);

        if (200 !== $response->getStatusCode()) {
            return;
        }

        $fullScriptFacade = json_decode($response->getBody(), true);
        $types = [
            'analytics' => 'Analytics',
            'message' => 'Message',
            'product' => 'Product',
            'banner' => 'AutopromoBanner',
            'iab_banner' => 'IabBanner',
        ];

        foreach ($types as $type => $element) {
            if (array_key_exists($type, $fullScriptFacade['script_codes'])) {
                $scriptSetter = 'set' . $element . 'Script';
                $codeSetter = 'set'. $element . 'Code';
                $this->cache->$scriptSetter($fullScriptFacade['script_codes'][$type]['script_name']);
                $this->cache->$codeSetter($fullScriptFacade['script_codes'][$type]['code']);
            } else {
                $clearer = 'clear' . $element . 'Data';
                $this->cache->$clearer();
            }
        }
    }
Get the script info and store them