Beispiel #1
0
 /**
  * @param array|\stdClass $data
  *
  * @return bool|void
  */
 protected function _processReceivedToken($data)
 {
     $_data = $data;
     if (!is_array($data) && !$data instanceof \stdClass && !$data instanceof \Traversable) {
         $_data = Option::clean($data);
         if (!empty($_data)) {
             $_data = current($_data);
         }
     }
     foreach ($_data as $_key => $_value) {
         switch ($_key) {
             case 'instance_url':
                 $this->_instanceName = trim(str_ireplace(array('https://', 'http://', '/'), null, $_value));
                 $_endpoint = $this->getConfig()->getEndpoint(EndpointTypes::SERVICE);
                 $_endpoint['endpoint'] = str_ireplace('{{instance_name}}', $this->_instanceName, static::SERVICE_ENDPOINT_PATTERN);
                 $this->getConfig()->mapEndpoint(EndpointTypes::SERVICE, $_endpoint);
                 break;
             case 'id':
                 $this->_identityUrl = $_value;
                 break;
         }
     }
     return parent::_processReceivedToken($data);
 }