diff --git a/Soap/SoapResponse.php b/Soap/SoapResponse.php index cb9c9a3..5fba41b 100644 --- a/Soap/SoapResponse.php +++ b/Soap/SoapResponse.php @@ -39,6 +39,17 @@ class SoapResponse extends Response $this->setReturnValue($returnValue); } + /** + * @param SoapHeader $soapHeader + */ + public function addSoapHeader(SoapHeader $soapHeader) + { + $this->soapHeaders->add($soapHeader); + } + + /** + * @return \BeSimple\SoapBundle\Util\Collection + */ public function getSoapHeaders() { return $this->soapHeaders; diff --git a/Util/Collection.php b/Util/Collection.php index 60b1256..4ea5699 100644 --- a/Util/Collection.php +++ b/Util/Collection.php @@ -28,8 +28,7 @@ class Collection implements \IteratorAggregate, \Countable throw new \InvalidArgumentException(sprintf('Cannot add class "%s" because it is not an instance of "%s"', get_class($element), $this->class)); } - $getter = $this->getter; - $this->elements[$element->$getter()] = $element; + $this->elements[$element->{$this->getter}()] = $element; } public function addAll($elements)