azure-storage-common/src/Common/Models/CORS.php
public static function create(array $parsedResponse)
    {
        Validate::hasKey(
            Resources::XTAG_ALLOWED_ORIGINS,
            'parsedResponse',
            $parsedResponse
        );
        Validate::hasKey(
            Resources::XTAG_ALLOWED_METHODS,
            'parsedResponse',
            $parsedResponse
        );
        Validate::hasKey(
            Resources::XTAG_ALLOWED_HEADERS,
            'parsedResponse',
            $parsedResponse
        );
        Validate::hasKey(
            Resources::XTAG_EXPOSED_HEADERS,
            'parsedResponse',
            $parsedResponse
        );
        Validate::hasKey(
            Resources::XTAG_MAX_AGE_IN_SECONDS,
            'parsedResponse',
            $parsedResponse
        );

        // Get the values from the parsed response.
        $allowedOrigins  = array_filter(explode(
            ',',
            $parsedResponse[Resources::XTAG_ALLOWED_ORIGINS]
        ));
        $allowedMethods  = array_filter(explode(
            ',',
            $parsedResponse[Resources::XTAG_ALLOWED_METHODS]
        ));
        $allowedHeaders  = array_filter(explode(
            ',',
            $parsedResponse[Resources::XTAG_ALLOWED_HEADERS]
        ));
        $exposedHeaders  = array_filter(explode(
            ',',
            $parsedResponse[Resources::XTAG_EXPOSED_HEADERS]
        ));
        $maxAgeInSeconds = intval(
            $parsedResponse[Resources::XTAG_MAX_AGE_IN_SECONDS]
        );

        return new CORS(
            $allowedOrigins,
            $allowedMethods,
            $allowedHeaders,
            $exposedHeaders,
            $maxAgeInSeconds
        );
    }
public static function create(array $parsedResponse)
    {
        Validate::hasKey(
            Resources::XTAG_ALLOWED_ORIGINS,
            'parsedResponse',
            $parsedResponse
        );
        Validate::hasKey(
            Resources::XTAG_ALLOWED_METHODS,
            'parsedResponse',
            $parsedResponse
        );
        Validate::hasKey(
            Resources::XTAG_ALLOWED_HEADERS,
            'parsedResponse',
            $parsedResponse
        );
        Validate::hasKey(
            Resources::XTAG_EXPOSED_HEADERS,
            'parsedResponse',
            $parsedResponse
        );
        Validate::hasKey(
            Resources::XTAG_MAX_AGE_IN_SECONDS,
            'parsedResponse',
            $parsedResponse
        );

        // Get the values from the parsed response.
        $allowedOrigins  = array_filter(explode(
            ',',
            $parsedResponse[Resources::XTAG_ALLOWED_ORIGINS]
        ));
        $allowedMethods  = array_filter(explode(
            ',',
            $parsedResponse[Resources::XTAG_ALLOWED_METHODS]
        ));
        $allowedHeaders  = array_filter(explode(
            ',',
            $parsedResponse[Resources::XTAG_ALLOWED_HEADERS]
        ));
        $exposedHeaders  = array_filter(explode(
            ',',
            $parsedResponse[Resources::XTAG_EXPOSED_HEADERS]
        ));
        $maxAgeInSeconds = intval(
            $parsedResponse[Resources::XTAG_MAX_AGE_IN_SECONDS]
        );

        return new CORS(
            $allowedOrigins,
            $allowedMethods,
            $allowedHeaders,
            $exposedHeaders,
            $maxAgeInSeconds
        );
    }
Create an instance with parsed XML response with 'CORS' root.

@param  array  $parsedResponse The response used to create an instance.

@internal

@return CORS