azure-storage-common/src/Common/Models/ServiceProperties.php
public static function create(array $parsedResponse)
    {
        $result = new ServiceProperties();

        if (array_key_exists(Resources::XTAG_DEFAULT_SERVICE_VERSION, $parsedResponse) &&
            $parsedResponse[Resources::XTAG_DEFAULT_SERVICE_VERSION] != null) {
            $result->setDefaultServiceVersion($parsedResponse[Resources::XTAG_DEFAULT_SERVICE_VERSION]);
        }

        if (array_key_exists(Resources::XTAG_LOGGING, $parsedResponse)) {
            $result->setLogging(Logging::create($parsedResponse[Resources::XTAG_LOGGING]));
        }
        $result->setHourMetrics(Metrics::create($parsedResponse[Resources::XTAG_HOUR_METRICS]));
        if (array_key_exists(Resources::XTAG_MINUTE_METRICS, $parsedResponse)) {
            $result->setMinuteMetrics(Metrics::create($parsedResponse[Resources::XTAG_MINUTE_METRICS]));
        }
        if (array_key_exists(Resources::XTAG_CORS, $parsedResponse) &&
            $parsedResponse[Resources::XTAG_CORS] != null) {
            //There could be multiple CORS rules, so need to extract them all.
            $corses = array();
            $corsArray =
                $parsedResponse[Resources::XTAG_CORS][Resources::XTAG_CORS_RULE];
            if (count(array_filter(array_keys($corsArray), 'is_string')) > 0) {
                //single cors rule
                $corses[] = CORS::create($corsArray);
            } else {
                //multiple cors rule
                foreach ($corsArray as $cors) {
                    $corses[] = CORS::create($cors);
                }
            }

            $result->setCorses($corses);
        } else {
            $result->setCorses(array());
        }

        return $result;
    }
public static function create(array $parsedResponse)
    {
        $result = new ServiceProperties();

        if (array_key_exists(Resources::XTAG_DEFAULT_SERVICE_VERSION, $parsedResponse) &&
            $parsedResponse[Resources::XTAG_DEFAULT_SERVICE_VERSION] != null) {
            $result->setDefaultServiceVersion($parsedResponse[Resources::XTAG_DEFAULT_SERVICE_VERSION]);
        }

        if (array_key_exists(Resources::XTAG_LOGGING, $parsedResponse)) {
            $result->setLogging(Logging::create($parsedResponse[Resources::XTAG_LOGGING]));
        }
        $result->setHourMetrics(Metrics::create($parsedResponse[Resources::XTAG_HOUR_METRICS]));
        if (array_key_exists(Resources::XTAG_MINUTE_METRICS, $parsedResponse)) {
            $result->setMinuteMetrics(Metrics::create($parsedResponse[Resources::XTAG_MINUTE_METRICS]));
        }
        if (array_key_exists(Resources::XTAG_CORS, $parsedResponse) &&
            $parsedResponse[Resources::XTAG_CORS] != null) {
            //There could be multiple CORS rules, so need to extract them all.
            $corses = array();
            $corsArray =
                $parsedResponse[Resources::XTAG_CORS][Resources::XTAG_CORS_RULE];
            if (count(array_filter(array_keys($corsArray), 'is_string')) > 0) {
                //single cors rule
                $corses[] = CORS::create($corsArray);
            } else {
                //multiple cors rule
                foreach ($corsArray as $cors) {
                    $corses[] = CORS::create($cors);
                }
            }

            $result->setCorses($corses);
        } else {
            $result->setCorses(array());
        }

        return $result;
    }
Creates ServiceProperties object from parsed XML response.

@internal
@param array $parsedResponse XML response parsed into array.

@return ServiceProperties.