Test Failed
Branch master (90c1c3)
by Fabian
03:08
created
src/LE_ACME2/Authorizer/AbstractAuthorizer.php 1 patch
Braces   +7 added lines, -10 removed lines patch added patch discarded remove patch
@@ -105,8 +105,9 @@  discard block
 block discarded – undo
105 105
 
106 106
         $this->_progressed = true;
107 107
 
108
-        if(!$this->_hasValidAuthorizationResponses())
109
-            return;
108
+        if(!$this->_hasValidAuthorizationResponses()) {
109
+                    return;
110
+        }
110 111
 
111 112
         $existsNotValidChallenges = false;
112 113
 
@@ -142,21 +143,17 @@  discard block
 block discarded – undo
142 143
             );
143 144
 
144 145
             return true;
145
-        }
146
-        else if($challenge->status == Response\Authorization\Struct\Challenge::STATUS_PROGRESSING) {
146
+        } else if($challenge->status == Response\Authorization\Struct\Challenge::STATUS_PROGRESSING) {
147 147
 
148 148
             // Should come back later
149 149
             return true;
150
-        }
151
-        else if($challenge->status == Response\Authorization\Struct\Challenge::STATUS_VALID) {
150
+        } else if($challenge->status == Response\Authorization\Struct\Challenge::STATUS_VALID) {
152 151
 
153
-        }
154
-        else if($challenge->status == Response\Authorization\Struct\Challenge::STATUS_INVALID) {
152
+        } else if($challenge->status == Response\Authorization\Struct\Challenge::STATUS_INVALID) {
155 153
             throw new Exception\AuthorizationInvalid(
156 154
                 'Received status "' . Response\Authorization\Struct\Challenge::STATUS_INVALID . '" while challenge should be verified'
157 155
             );
158
-        }
159
-        else {
156
+        } else {
160 157
 
161 158
             throw new \RuntimeException('Challenge status "' . $challenge->status . '" is not implemented');
162 159
         }
Please login to merge, or discard this patch.
src/LE_ACME2/Order.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@  discard block
 block discarded – undo
40 40
 
41 41
         array_map(function($subject) {
42 42
 
43
-            if(preg_match_all('~(\*\.)~', $subject) > 1)
44
-                throw new \RuntimeException('Cannot create orders with multiple wildcards in one domain.');
43
+            if(preg_match_all('~(\*\.)~', $subject) > 1) {
44
+                            throw new \RuntimeException('Cannot create orders with multiple wildcards in one domain.');
45
+            }
45 46
 
46 47
         }, $subjects);
47 48
 
@@ -125,8 +126,9 @@  discard block
 block discarded – undo
125 126
 
126 127
         $order = new self($account, $subjects);
127 128
 
128
-        if(!self::exists($account, $subjects))
129
-            throw new \RuntimeException('Order does not exist');
129
+        if(!self::exists($account, $subjects)) {
130
+                    throw new \RuntimeException('Order does not exist');
131
+        }
130 132
 
131 133
         return $order;
132 134
     }
Please login to merge, or discard this patch.
src/LE_ACME2/Response/AbstractResponse.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,9 @@
 block discarded – undo
48 48
 
49 49
         foreach($this->_raw->header as $line) {
50 50
 
51
-            if(preg_match($pattern, $line, $matches) === 1)
52
-                return $matches;
51
+            if(preg_match($pattern, $line, $matches) === 1) {
52
+                            return $matches;
53
+            }
53 54
         }
54 55
         return null;
55 56
     }
Please login to merge, or discard this patch.
src/LE_ACME2/Utilities/Logger.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function add(int $level, string $message, array $data = array()) {
39 39
 
40
-        if($level > $this->_desiredLevel)
41
-            return;
40
+        if($level > $this->_desiredLevel) {
41
+                    return;
42
+        }
42 43
 
43 44
         if($this->_psrLogger) {
44 45
 
@@ -72,8 +73,9 @@  discard block
 block discarded – undo
72 73
                 $step++;
73 74
             }
74 75
 
75
-            if ((is_array($data) && count($data) > 0) || !is_array($data))
76
-                $output .= "\n" .'<br/>Data:<br/>' . "\n" . '<pre>' . var_export($data, true) . '</pre>';
76
+            if ((is_array($data) && count($data) > 0) || !is_array($data)) {
77
+                            $output .= "\n" .'<br/>Data:<br/>' . "\n" . '<pre>' . var_export($data, true) . '</pre>';
78
+            }
77 79
 
78 80
             $output .= '<br><br>' . "\n\n";
79 81
         }
Please login to merge, or discard this patch.
src/LE_ACME2/Utilities/KeyGenerator.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
18 18
             "private_key_bits" => 4096,
19 19
         ]);
20 20
 
21
-        if(!openssl_pkey_export($res, $privateKey))
22
-            throw new \RuntimeException("RSA keypair export failed!");
21
+        if(!openssl_pkey_export($res, $privateKey)) {
22
+                    throw new \RuntimeException("RSA keypair export failed!");
23
+        }
23 24
 
24 25
         $details = openssl_pkey_get_details($res);
25 26
 
@@ -41,16 +42,18 @@  discard block
 block discarded – undo
41 42
      */
42 43
     public static function EC(string $directory, string $privateKeyFile = 'private.pem', string $publicKeyFile = 'public.pem') {
43 44
 
44
-        if (version_compare(PHP_VERSION, '7.1.0') == -1)
45
-            throw new \RuntimeException("PHP 7.1+ required for EC keys");
45
+        if (version_compare(PHP_VERSION, '7.1.0') == -1) {
46
+                    throw new \RuntimeException("PHP 7.1+ required for EC keys");
47
+        }
46 48
 
47 49
         $res = openssl_pkey_new([
48 50
             "private_key_type" => OPENSSL_KEYTYPE_EC,
49 51
             "curve_name" => "prime256v1",
50 52
         ]);
51 53
 
52
-        if(!openssl_pkey_export($res, $privateKey))
53
-            throw new \RuntimeException("EC keypair export failed!");
54
+        if(!openssl_pkey_export($res, $privateKey)) {
55
+                    throw new \RuntimeException("EC keypair export failed!");
56
+        }
54 57
 
55 58
         $details = openssl_pkey_get_details($res);
56 59
 
Please login to merge, or discard this patch.
src/LE_ACME2/Request/Order/Finalize.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@
 block discarded – undo
33 33
 
34 34
         $csr = Utilities\Certificate::generateCSR($this->_order);
35 35
 
36
-        if(preg_match('~-----BEGIN\sCERTIFICATE\sREQUEST-----(.*)-----END\sCERTIFICATE\sREQUEST-----~s', $csr, $matches))
37
-            $csr = $matches[1];
36
+        if(preg_match('~-----BEGIN\sCERTIFICATE\sREQUEST-----(.*)-----END\sCERTIFICATE\sREQUEST-----~s', $csr, $matches)) {
37
+                    $csr = $matches[1];
38
+        }
38 39
 
39 40
         $csr = trim(Utilities\Base64::UrlSafeEncode(base64_decode($csr)));
40 41
 
Please login to merge, or discard this patch.
src/LE_ACME2/Account.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,8 +83,9 @@  discard block
 block discarded – undo
83 83
 
84 84
         $account = new self($email);
85 85
 
86
-        if(!self::exists($email))
87
-            throw new \RuntimeException('Keys not found - does this account exist?');
86
+        if(!self::exists($email)) {
87
+                    throw new \RuntimeException('Keys not found - does this account exist?');
88
+        }
88 89
 
89 90
         return $account;
90 91
     }
@@ -116,8 +117,9 @@  discard block
 block discarded – undo
116 117
 
117 118
             $this->_setEmail($email);
118 119
 
119
-            if($previousKeyDirectoryPath != $this->getKeyDirectoryPath())
120
-                rename($previousKeyDirectoryPath, $this->getKeyDirectoryPath());
120
+            if($previousKeyDirectoryPath != $this->getKeyDirectoryPath()) {
121
+                            rename($previousKeyDirectoryPath, $this->getKeyDirectoryPath());
122
+            }
121 123
 
122 124
             return true;
123 125
 
Please login to merge, or discard this patch.