| Conditions | 3 |
| Paths | 7 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function __construct($params = null) |
||
| 38 | { |
||
| 39 | if (!$params instanceof \DOMDocument) { |
||
| 40 | parent::__construct($params); |
||
| 41 | return; |
||
| 42 | } |
||
| 43 | try { |
||
| 44 | $this->serverUrl = $params->getElementsByTagName('serverUrl')[0]->nodeValue; |
||
| 45 | $this->sessionId = $params->getElementsByTagName('sessionId')[0]->nodeValue; |
||
| 46 | $this->userId = $params->getElementsByTagName('userId')[0]->nodeValue; |
||
| 47 | |||
| 48 | // extract the instance portion of the URL. |
||
| 49 | preg_match('/https:\/\/(.*)\.salesforce\.com/', $this->serverUrl, $matches); |
||
| 50 | $this->instance = $matches[1]; |
||
| 51 | } catch (\Exception $e) { |
||
| 52 | throw new SFClientException('SF Api waiting behavior changed. Parse response error: ' . $e->getMessage()); |
||
| 53 | } |
||
| 72 |