@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | /** |
| 658 | 658 | * Check whether the NameId is encrypted. |
| 659 | 659 | * |
| 660 | - * @return true if the NameId is encrypted, false if not. |
|
| 660 | + * @return boolean if the NameId is encrypted, false if not. |
|
| 661 | 661 | */ |
| 662 | 662 | public function isNameIdEncrypted() |
| 663 | 663 | { |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | * This function returns null if there are no restrictions on how early the |
| 786 | 786 | * assertion can be used. |
| 787 | 787 | * |
| 788 | - * @return int|null The earliest timestamp this assertion is valid. |
|
| 788 | + * @return integer The earliest timestamp this assertion is valid. |
|
| 789 | 789 | */ |
| 790 | 790 | public function getNotBefore() |
| 791 | 791 | { |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | * This function returns null if there are no restrictions on how |
| 813 | 813 | * late the assertion can be used. |
| 814 | 814 | * |
| 815 | - * @return int|null The latest timestamp this assertion is valid. |
|
| 815 | + * @return integer The latest timestamp this assertion is valid. |
|
| 816 | 816 | */ |
| 817 | 817 | public function getNotOnOrAfter() |
| 818 | 818 | { |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | /** |
| 871 | 871 | * Retrieve the AuthnInstant of the assertion. |
| 872 | 872 | * |
| 873 | - * @return int|null The timestamp the user was authenticated, or NULL if the user isn't authenticated. |
|
| 873 | + * @return integer The timestamp the user was authenticated, or NULL if the user isn't authenticated. |
|
| 874 | 874 | */ |
| 875 | 875 | public function getAuthnInstant() |
| 876 | 876 | { |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | * See: |
| 1033 | 1033 | * @url http://docs.oasis-open.org/security/saml/v2.0/saml-authn-context-2.0-os.pdf |
| 1034 | 1034 | * |
| 1035 | - * @return \SAML2\XML\Chunk|null |
|
| 1035 | + * @return Chunk |
|
| 1036 | 1036 | */ |
| 1037 | 1037 | public function getAuthnContextDecl() |
| 1038 | 1038 | { |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | * |
| 1063 | 1063 | * The URI reference MAY directly resolve into an XML document containing the referenced declaration. |
| 1064 | 1064 | * |
| 1065 | - * @return string |
|
| 1065 | + * @return Chunk |
|
| 1066 | 1066 | */ |
| 1067 | 1067 | public function getAuthnContextDeclRef() |
| 1068 | 1068 | { |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | /** |
| 1095 | 1095 | * Retrieve all attributes. |
| 1096 | 1096 | * |
| 1097 | - * @return array All attributes, as an associative array. |
|
| 1097 | + * @return \DOMElement[] All attributes, as an associative array. |
|
| 1098 | 1098 | */ |
| 1099 | 1099 | public function getAttributes() |
| 1100 | 1100 | { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | if ($xml->getAttribute('Version') !== '2.0') { |
| 242 | 242 | /* Currently a very strict check. */ |
| 243 | - throw new \Exception('Unsupported version: ' . $xml->getAttribute('Version')); |
|
| 243 | + throw new \Exception('Unsupported version: '.$xml->getAttribute('Version')); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | $this->issueInstant = Utils::xsDateTimeToTimestamp($xml->getAttribute('IssueInstant')); |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | continue; |
| 341 | 341 | } |
| 342 | 342 | if ($node->namespaceURI !== Constants::NS_SAML) { |
| 343 | - throw new \Exception('Unknown namespace of condition: ' . var_export($node->namespaceURI, true)); |
|
| 343 | + throw new \Exception('Unknown namespace of condition: '.var_export($node->namespaceURI, true)); |
|
| 344 | 344 | } |
| 345 | 345 | switch ($node->localName) { |
| 346 | 346 | case 'AudienceRestriction': |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | /* Currently ignored. */ |
| 364 | 364 | break; |
| 365 | 365 | default: |
| 366 | - throw new \Exception('Unknown condition: ' . var_export($node->localName, true)); |
|
| 366 | + throw new \Exception('Unknown condition: '.var_export($node->localName, true)); |
|
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | 369 | } |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | $document = $parentElement->ownerDocument; |
| 1245 | 1245 | } |
| 1246 | 1246 | |
| 1247 | - $root = $document->createElementNS(Constants::NS_SAML, 'saml:' . 'Assertion'); |
|
| 1247 | + $root = $document->createElementNS(Constants::NS_SAML, 'saml:'.'Assertion'); |
|
| 1248 | 1248 | $parentElement->appendChild($root); |
| 1249 | 1249 | |
| 1250 | 1250 | /* Ugly hack to add another namespace declaration to the root element. */ |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | if ($this->encryptedNameId === null) { |
| 1297 | 1297 | Utils::addNameId($subject, $this->nameId); |
| 1298 | 1298 | } else { |
| 1299 | - $eid = $subject->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedID'); |
|
| 1299 | + $eid = $subject->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:'.'EncryptedID'); |
|
| 1300 | 1300 | $subject->appendChild($eid); |
| 1301 | 1301 | $eid->appendChild($subject->ownerDocument->importNode($this->encryptedNameId, true)); |
| 1302 | 1302 | } |
@@ -569,7 +569,7 @@ |
||
| 569 | 569 | * The returned NameId is in the format used by \SAML2\Utils::addNameId(). |
| 570 | 570 | * |
| 571 | 571 | * @see \SAML2\Utils::addNameId() |
| 572 | - * @return array|null The name identifier of the assertion. |
|
| 572 | + * @return string The name identifier of the assertion. |
|
| 573 | 573 | * @throws \Exception |
| 574 | 574 | */ |
| 575 | 575 | public function getNameId() |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | /** |
| 108 | 108 | * Check whether the NameId is encrypted. |
| 109 | 109 | * |
| 110 | - * @return true if the NameId is encrypted, false if not. |
|
| 110 | + * @return boolean if the NameId is encrypted, false if not. |
|
| 111 | 111 | */ |
| 112 | 112 | public function isNameIdEncrypted() |
| 113 | 113 | { |
@@ -264,7 +264,7 @@ |
||
| 264 | 264 | if ($this->encryptedNameId === null) { |
| 265 | 265 | Utils::addNameId($root, $this->nameId); |
| 266 | 266 | } else { |
| 267 | - $eid = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedID'); |
|
| 267 | + $eid = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:'.'EncryptedID'); |
|
| 268 | 268 | $root->appendChild($eid); |
| 269 | 269 | $eid->appendChild($root->ownerDocument->importNode($this->encryptedNameId, true)); |
| 270 | 270 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | /** |
| 46 | 46 | * Retrieve the assertions in this response. |
| 47 | 47 | * |
| 48 | - * @return \SAML2\Assertion[]|\SAML2\EncryptedAssertion[] |
|
| 48 | + * @return Utilities\ArrayCollection |
|
| 49 | 49 | */ |
| 50 | 50 | public function getAssertions() |
| 51 | 51 | { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * @param \SAML2\Configuration\Destination $currentDestination |
| 65 | 65 | * @param \SAML2\Response $response |
| 66 | 66 | * |
| 67 | - * @return \SAML2\Assertion[] Collection (\SAML2\Utilities\ArrayCollection) of \SAML2\Assertion objects |
|
| 67 | + * @return \SAML2\Utilities\ArrayCollection Collection (\SAML2\Utilities\ArrayCollection) of \SAML2\Assertion objects |
|
| 68 | 68 | */ |
| 69 | 69 | public function process( |
| 70 | 70 | ServiceProvider $serviceProviderConfiguration, |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | /** |
| 135 | 135 | * @param \SAML2\Response $response |
| 136 | 136 | * |
| 137 | - * @return \SAML2\Assertion[] |
|
| 137 | + * @return \SAML2\Utilities\ArrayCollection |
|
| 138 | 138 | */ |
| 139 | 139 | private function processAssertions(Response $response) |
| 140 | 140 | { |
@@ -212,6 +212,10 @@ |
||
| 212 | 212 | * @param $soapmessage Soap response needs to be type DOMDocument |
| 213 | 213 | * @return $soapfaultstring string|null |
| 214 | 214 | */ |
| 215 | + |
|
| 216 | + /** |
|
| 217 | + * @param \DOMDocument $soapMessage |
|
| 218 | + */ |
|
| 215 | 219 | private function getSOAPFault($soapMessage) |
| 216 | 220 | { |
| 217 | 221 | $soapFault = Utils::xpQuery($soapMessage->firstChild, '/soap-env:Envelope/soap-env:Body/soap-env:Fault'); |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | $privateKey = SimpleSAML_Utilities::loadPrivateKey($srcMetadata); |
| 52 | 52 | $publicKey = SimpleSAML_Utilities::loadPublicKey($srcMetadata); |
| 53 | 53 | if ($privateKey !== null && $publicKey !== null && isset($publicKey['PEM'])) { |
| 54 | - $keyCertData = $privateKey['PEM'] . $publicKey['PEM']; |
|
| 55 | - $file = SimpleSAML_Utilities::getTempDir() . '/' . sha1($keyCertData) . '.pem'; |
|
| 54 | + $keyCertData = $privateKey['PEM'].$publicKey['PEM']; |
|
| 55 | + $file = SimpleSAML_Utilities::getTempDir().'/'.sha1($keyCertData).'.pem'; |
|
| 56 | 56 | if (!file_exists($file)) { |
| 57 | 57 | SimpleSAML_Utilities::writeFile($file, $keyCertData); |
| 58 | 58 | } |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | if ($key['type'] !== 'X509Certificate') { |
| 72 | 72 | continue; |
| 73 | 73 | } |
| 74 | - $certData .= "-----BEGIN CERTIFICATE-----\n" . |
|
| 75 | - chunk_split($key['X509Certificate'], 64) . |
|
| 74 | + $certData .= "-----BEGIN CERTIFICATE-----\n". |
|
| 75 | + chunk_split($key['X509Certificate'], 64). |
|
| 76 | 76 | "-----END CERTIFICATE-----\n"; |
| 77 | 77 | } |
| 78 | - $peerCertFile = SimpleSAML_Utilities::getTempDir() . '/' . sha1($certData) . '.pem'; |
|
| 78 | + $peerCertFile = SimpleSAML_Utilities::getTempDir().'/'.sha1($certData).'.pem'; |
|
| 79 | 79 | if (!file_exists($peerCertFile)) { |
| 80 | 80 | SimpleSAML_Utilities::writeFile($peerCertFile, $certData); |
| 81 | 81 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | // Add soap-envelopes |
| 102 | 102 | $request = $msg->toSignedXML(); |
| 103 | - $request = self::START_SOAP_ENVELOPE . $request->ownerDocument->saveXML($request) . self::END_SOAP_ENVELOPE; |
|
| 103 | + $request = self::START_SOAP_ENVELOPE.$request->ownerDocument->saveXML($request).self::END_SOAP_ENVELOPE; |
|
| 104 | 104 | |
| 105 | 105 | Utils::getContainer()->debugMessage($request, 'out'); |
| 106 | 106 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | // There is a fault element but we haven't found out what the fault string is |
| 226 | 226 | $soapFaultString = "Unknown fault string found"; |
| 227 | 227 | // find out the fault string |
| 228 | - $faultStringElement = Utils::xpQuery($soapFaultElement, './soap-env:faultstring') ; |
|
| 228 | + $faultStringElement = Utils::xpQuery($soapFaultElement, './soap-env:faultstring'); |
|
| 229 | 229 | if (!empty($faultStringElement)) { |
| 230 | 230 | return $faultStringElement[0]->textContent; |
| 231 | 231 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | case Constants::BINDING_HOK_SSO: |
| 40 | 40 | return new HTTPPost(); |
| 41 | 41 | default: |
| 42 | - throw new \Exception('Unsupported binding: ' . var_export($urn, true)); |
|
| 42 | + throw new \Exception('Unsupported binding: '.var_export($urn, true)); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
@@ -85,15 +85,15 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $logger = Utils::getContainer()->getLogger(); |
| 87 | 87 | $logger->warning('Unable to find the SAML 2 binding used for this request.'); |
| 88 | - $logger->warning('Request method: ' . var_export($_SERVER['REQUEST_METHOD'], true)); |
|
| 88 | + $logger->warning('Request method: '.var_export($_SERVER['REQUEST_METHOD'], true)); |
|
| 89 | 89 | if (!empty($_GET)) { |
| 90 | - $logger->warning("GET parameters: '" . implode("', '", array_map('addslashes', array_keys($_GET))) . "'"); |
|
| 90 | + $logger->warning("GET parameters: '".implode("', '", array_map('addslashes', array_keys($_GET)))."'"); |
|
| 91 | 91 | } |
| 92 | 92 | if (!empty($_POST)) { |
| 93 | - $logger->warning("POST parameters: '" . implode("', '", array_map('addslashes', array_keys($_POST))) . "'"); |
|
| 93 | + $logger->warning("POST parameters: '".implode("', '", array_map('addslashes', array_keys($_POST)))."'"); |
|
| 94 | 94 | } |
| 95 | 95 | if (isset($_SERVER['CONTENT_TYPE'])) { |
| 96 | - $logger->warning('Content-Type: ' . var_export($_SERVER['CONTENT_TYPE'], true)); |
|
| 96 | + $logger->warning('Content-Type: '.var_export($_SERVER['CONTENT_TYPE'], true)); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | throw new \Exception('Unable to find the current binding.'); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function emergency($message, array $context = array()) |
| 15 | 15 | { |
| 16 | - SimpleSAML_Logger::emergency($message . var_export($context, true)); |
|
| 16 | + SimpleSAML_Logger::emergency($message.var_export($context, true)); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function alert($message, array $context = array()) |
| 30 | 30 | { |
| 31 | - SimpleSAML_Logger::alert($message . var_export($context, true)); |
|
| 31 | + SimpleSAML_Logger::alert($message.var_export($context, true)); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function critical($message, array $context = array()) |
| 44 | 44 | { |
| 45 | - SimpleSAML_Logger::critical($message . var_export($context, true)); |
|
| 45 | + SimpleSAML_Logger::critical($message.var_export($context, true)); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function error($message, array $context = array()) |
| 57 | 57 | { |
| 58 | - SimpleSAML_Logger::error($message . var_export($context, true)); |
|
| 58 | + SimpleSAML_Logger::error($message.var_export($context, true)); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function warning($message, array $context = array()) |
| 72 | 72 | { |
| 73 | - SimpleSAML_Logger::warning($message . var_export($context, true)); |
|
| 73 | + SimpleSAML_Logger::warning($message.var_export($context, true)); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function notice($message, array $context = array()) |
| 84 | 84 | { |
| 85 | - SimpleSAML_Logger::notice($message . var_export($context, true)); |
|
| 85 | + SimpleSAML_Logger::notice($message.var_export($context, true)); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function info($message, array $context = array()) |
| 98 | 98 | { |
| 99 | - SimpleSAML_Logger::info($message . var_export($context, true)); |
|
| 99 | + SimpleSAML_Logger::info($message.var_export($context, true)); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function debug($message, array $context = array()) |
| 110 | 110 | { |
| 111 | - SimpleSAML_Logger::debug($message . var_export($context, true)); |
|
| 111 | + SimpleSAML_Logger::debug($message.var_export($context, true)); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | public function getPrivateKey($name, $required = false) |
| 49 | 49 | { |
| 50 | 50 | $privateKeys = $this->get('privateKeys'); |
| 51 | - $key = array_filter($privateKeys, function (PrivateKey $key) use ($name) { |
|
| 51 | + $key = array_filter($privateKeys, function(PrivateKey $key) use ($name) { |
|
| 52 | 52 | return $key->getName() === $name; |
| 53 | 53 | }); |
| 54 | 54 | |