| Conditions | 3 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function __construct($wsdl, $options) |
||
| 22 | { |
||
| 23 | // If a version was set then add it to the headers. |
||
| 24 | if (!empty($options['version'])) { |
||
| 25 | $this->__default_headers[] = new \SoapHeader( |
||
|
|
|||
| 26 | 'http://schemas.microsoft.com/exchange/services/2006/types', |
||
| 27 | 'RequestServerVersion Version="' . $options['version'] . '"' |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | // If impersonation was set then add it to the headers. |
||
| 32 | if (!empty($options['impersonation'])) { |
||
| 33 | $this->__default_headers[] = new \SoapHeader( |
||
| 34 | 'http://schemas.microsoft.com/exchange/services/2006/types', |
||
| 35 | 'ExchangeImpersonation', |
||
| 36 | $options['impersonation'] |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | |||
| 40 | parent::__construct($wsdl, $options); |
||
| 41 | } |
||
| 42 | |||
| 53 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: