trace = $trace; $this->exceptions = $exceptions; $this->userAgent = $userAgent; $this->compression = $compression; $this->authentication = $authentication; $this->proxy = $proxy; } public function getTrace() { return $this->trace; } public function getExceptions() { return $this->exceptions; } public function getUserAgent() { return $this->userAgent; } public function hasCompression() { return $this->compression !== self::SOAP_CLIENT_COMPRESSION_NONE; } public function getCompression() { return $this->compression; } public function hasAuthentication() { return $this->authentication !== null; } public function hasProxy() { return $this->proxy !== null; } public function getAuthentication() { return $this->authentication; } public function getProxy() { return $this->proxy; } public function toArray() { $optionsAsArray = [ 'trace' => $this->getTrace(), 'exceptions' => $this->getExceptions(), 'user_agent' => $this->getUserAgent(), ]; if ($this->hasCompression()) { $optionsAsArray['compression'] = $this->getCompression(); } if ($this->hasAuthentication()) { $optionsAsArray += $this->getAuthentication()->toArray(); } if ($this->hasProxy()) { $optionsAsArray += $this->getProxy()->toArray(); } return $optionsAsArray; } }