diff --git a/lib/SimpleSAML/XML/Signer.php b/lib/SimpleSAML/XML/Signer.php index f84a335448fa88d654228595e444827841d55b68..e4a04e05ae4bcf4db0998e5bdb95f6e9235475d9 100644 --- a/lib/SimpleSAML/XML/Signer.php +++ b/lib/SimpleSAML/XML/Signer.php @@ -20,28 +20,26 @@ use SimpleSAML\Utils\Config; class Signer { - - /** * @var string The name of the ID attribute. */ - private $idAttrName; + private $idAttrName = ''; /** * @var XMLSecurityKey|bool The private key (as an XMLSecurityKey). */ - private $privateKey; + private $privateKey = false; /** - * @var string The certificate (as text). + * @var string|bool The certificate (as text). */ - private $certificate; + private $certificate = false; /** * @var array Extra certificates which should be included in the response. */ - private $extraCertificates; + private $extraCertificates = array(); /** @@ -64,11 +62,6 @@ class Signer { assert(is_array($options)); - $this->idAttrName = false; - $this->privateKey = false; - $this->certificate = false; - $this->extraCertificates = array(); - if (array_key_exists('privatekey', $options)) { $pass = null; if (array_key_exists('privatekey_pass', $options)) { @@ -291,7 +284,7 @@ class Signer $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); $options = array(); - if ($this->idAttrName !== false) { + if (!empty($this->idAttrName)) { $options['id_name'] = $this->idAttrName; }