public static function getAuthEnv($keys = null, $debug = false)
    {
        if (!$keys) {
            $msg = 'Keys parameter is required. (Keys to set from env)';
            throw new ApiException($msg);
        }

        /*
         * Some tests require all parameters to be from environment.
         * Otherwise, they are skipped.
         */
        $env = true;

        /*
         * To use, export the required environment vars:
         *   export ma_vendorId=VALUE
         *   export ma_vendorPassword=VALUE
         *   export ma_userId=VALUE
         *   export ma_userPassword=VALUE
         *   export ma_userToken=VALUE
         *   export ma_propertyId=VALUE
         *   export ma_PMSUserId=VALUE
         *   export ma_PMSPropertyId=VALUE
         */
        foreach ($keys as $k) {
            if (!($$k = getenv('ma_'.$k))) {
                // Key does not exist in environment, use test data
                $$k = '111';
                $env = false;
            }
        }

        $auth = new Auth();
        $auth->vendorId = isset($vendorId) ? $vendorId : null;
        $auth->vendorPassword = isset($vendorPassword) ? $vendorPassword : null;
        $auth->userId = isset($userId) ? $userId: null;
        $auth->userPassword = isset($userPassword) ? $userPassword : null;
        $auth->userToken = isset($userToken) ? $userToken : null;
        $auth->PMSUserId = isset($PMSUserId) ? $PMSUserId : null;
        $auth->propertyId = isset($propertyId) ? $propertyId : null;
        $auth->PMSPropertyId = isset($PMSPropertyId) ? $PMSPropertyId : null;
        $auth->debug = $debug;

        return array(
            'auth' => $auth,
            'from_env' => $env
        );
    }
public static function getAuthEnv($keys = null, $debug = false)
    {
        if (!$keys) {
            $msg = 'Keys parameter is required. (Keys to set from env)';
            throw new ApiException($msg);
        }

        /*
         * Some tests require all parameters to be from environment.
         * Otherwise, they are skipped.
         */
        $env = true;

        /*
         * To use, export the required environment vars:
         *   export ma_vendorId=VALUE
         *   export ma_vendorPassword=VALUE
         *   export ma_userId=VALUE
         *   export ma_userPassword=VALUE
         *   export ma_userToken=VALUE
         *   export ma_propertyId=VALUE
         *   export ma_PMSUserId=VALUE
         *   export ma_PMSPropertyId=VALUE
         */
        foreach ($keys as $k) {
            if (!($$k = getenv('ma_'.$k))) {
                // Key does not exist in environment, use test data
                $$k = '111';
                $env = false;
            }
        }

        $auth = new Auth();
        $auth->vendorId = isset($vendorId) ? $vendorId : null;
        $auth->vendorPassword = isset($vendorPassword) ? $vendorPassword : null;
        $auth->userId = isset($userId) ? $userId: null;
        $auth->userPassword = isset($userPassword) ? $userPassword : null;
        $auth->userToken = isset($userToken) ? $userToken : null;
        $auth->PMSUserId = isset($PMSUserId) ? $PMSUserId : null;
        $auth->propertyId = isset($propertyId) ? $propertyId : null;
        $auth->PMSPropertyId = isset($PMSPropertyId) ? $PMSPropertyId : null;
        $auth->debug = $debug;

        return array(
            'auth' => $auth,
            'from_env' => $env
        );
    }
public static function getAuthEnv ( $ keys = null , $ debug = false ) { if ( ! $ keys ) { $ msg = 'Keys parameter is required. (Keys to set from env)' ; throw new ApiException ( $ msg ) ; } /*
         * Some tests require all parameters to be from environment.
         * Otherwise, they are skipped.
         */ $ env = true ; /*
         * To use, export the required environment vars:
         *   export ma_vendorId=VALUE
         *   export ma_vendorPassword=VALUE
         *   export ma_userId=VALUE
         *   export ma_userPassword=VALUE
         *   export ma_userToken=VALUE
         *   export ma_propertyId=VALUE
         *   export ma_PMSUserId=VALUE
         *   export ma_PMSPropertyId=VALUE
         */ foreach ( $ keys as $ k ) { if ( ! ( $ $ k = getenv ( 'ma_' . $ k ) ) ) { // Key does not exist in environment, use test data $ $ k = '111' ; $ env = false ; } } $ auth = new Auth ( ) ; $ auth -> vendorId = isset ( $ vendorId ) ? $ vendorId : null ; $ auth -> vendorPassword = isset ( $ vendorPassword ) ? $ vendorPassword : null ; $ auth -> userId = isset ( $ userId ) ? $ userId : null ; $ auth -> userPassword = isset ( $ userPassword ) ? $ userPassword : null ; $ auth -> userToken = isset ( $ userToken ) ? $ userToken : null ; $ auth -> PMSUserId = isset ( $ PMSUserId ) ? $ PMSUserId : null ; $ auth -> propertyId = isset ( $ propertyId ) ? $ propertyId : null ; $ auth -> PMSPropertyId = isset ( $ PMSPropertyId ) ? $ PMSPropertyId : null ; $ auth -> debug = $ debug ; return array ( 'auth' => $ auth , 'from_env' => $ env ) ; }
Get an auth object from the local ENV or test data.

@param array $keys The authentication keys to set.
@param string $debug Enable debug.

@return array(Auth, string) Authentication object and bool if pulled from ENV.

@throws MyAllocator\phpsdk\src\Exception\ApiException If no keys supplied.
Get an auth object from the local ENV or test data .