Completed
Push — master ( 746563...99649c )
by Thijs
07:14
created
src/SAML2/Response.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/SAML2/Response/Processor.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/SAML2/SOAPClient.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -212,6 +212,10 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/SAML2/Binding.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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.');
Please login to merge, or discard this patch.
src/SAML2/Configuration/IdentityProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/SAML2/Configuration/ServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     public function getPrivateKey($name, $required = false)
51 51
     {
52 52
         $privateKeys = $this->get('privateKeys');
53
-        $key         = array_filter($privateKeys, function (PrivateKey $key) use ($name) {
53
+        $key         = array_filter($privateKeys, function(PrivateKey $key) use ($name) {
54 54
             return $key->getName() === $name;
55 55
         });
56 56
 
Please login to merge, or discard this patch.
src/SAML2/Constants.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@
 block discarded – undo
53 53
     const CM_BEARER = 'urn:oasis:names:tc:SAML:2.0:cm:bearer';
54 54
 
55 55
     /**
56
-    * Holder-of-Key subject confirmation method.
57
-    */
56
+     * Holder-of-Key subject confirmation method.
57
+     */
58 58
     const CM_HOK = 'urn:oasis:names:tc:SAML:2.0:cm:holder-of-key';
59 59
     
60 60
     /**
Please login to merge, or discard this patch.
src/SAML2/EncryptedAssertion.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                 break;
76 76
 
77 77
             default:
78
-                throw new \Exception('Unknown key type for encryption: ' . $key->type);
78
+                throw new \Exception('Unknown key type for encryption: '.$key->type);
79 79
         }
80 80
 
81 81
         $this->encryptedData = $enc->encryptNode($symmetricKey);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             $document = $parentElement->ownerDocument;
113 113
         }
114 114
 
115
-        $root = $document->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedAssertion');
115
+        $root = $document->createElementNS(Constants::NS_SAML, 'saml:'.'EncryptedAssertion');
116 116
         $parentElement->appendChild($root);
117 117
 
118 118
         $root->appendChild($document->importNode($this->encryptedData, true));
Please login to merge, or discard this patch.
src/SAML2/HTTPArtifact.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         }
36 36
 
37 37
         $generatedId = pack('H*', ((string) SimpleSAML_Utilities::stringToHex(SimpleSAML_Utilities::generateRandomBytes(20))));
38
-        $artifact = base64_encode("\x00\x04\x00\x00" . sha1($message->getIssuer(), true) . $generatedId) ;
38
+        $artifact = base64_encode("\x00\x04\x00\x00".sha1($message->getIssuer(), true).$generatedId);
39 39
         $artifactData = $message->toUnsignedXML();
40 40
         $artifactDataString = $artifactData->ownerDocument->saveXML($artifactData);
41 41
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     {
78 78
         if (array_key_exists('SAMLart', $_REQUEST)) {
79 79
             $artifact = base64_decode($_REQUEST['SAMLart']);
80
-            $endpointIndex =  bin2hex(substr($artifact, 2, 2));
80
+            $endpointIndex = bin2hex(substr($artifact, 2, 2));
81 81
             $sourceId = bin2hex(substr($artifact, 4, 20));
82 82
         } else {
83 83
             throw new \Exception('Missing SAMLArt parameter.');
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
         $idpMetadata = $metadataHandler->getMetaDataConfigForSha1($sourceId, 'saml20-idp-remote');
89 89
 
90 90
         if ($idpMetadata === null) {
91
-            throw new \Exception('No metadata found for remote provider with SHA1 ID: ' . var_export($sourceId, true));
91
+            throw new \Exception('No metadata found for remote provider with SHA1 ID: '.var_export($sourceId, true));
92 92
         }
93 93
 
94 94
         $endpoint = null;
95 95
         foreach ($idpMetadata->getEndpoints('ArtifactResolutionService') as $ep) {
96
-            if ($ep['index'] ===  hexdec($endpointIndex)) {
96
+            if ($ep['index'] === hexdec($endpointIndex)) {
97 97
                 $endpoint = $ep;
98 98
                 break;
99 99
             }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             throw new \Exception('No ArtifactResolutionService with the correct index.');
104 104
         }
105 105
 
106
-        Utils::getContainer()->getLogger()->debug("ArtifactResolutionService endpoint being used is := " . $endpoint['Location']);
106
+        Utils::getContainer()->getLogger()->debug("ArtifactResolutionService endpoint being used is := ".$endpoint['Location']);
107 107
 
108 108
         //Construct the ArtifactResolve Request
109 109
         $ar = new ArtifactResolve();
Please login to merge, or discard this patch.