@@ -59,7 +59,9 @@ discard block |
||
59 | 59 | { |
60 | 60 | parent::__construct($headers); |
61 | 61 | |
62 | - if(count($headers) === 0 ) return; |
|
62 | + if(count($headers) === 0 ) { |
|
63 | + return; |
|
64 | + } |
|
63 | 65 | |
64 | 66 | // certificates |
65 | 67 | if(in_array(PublicJSONWebKeyParameters::X_509CertificateChain, $headers) && is_array($headers[PublicJSONWebKeyParameters::X_509CertificateChain])){ |
@@ -104,8 +106,9 @@ discard block |
||
104 | 106 | */ |
105 | 107 | public function setVisibility($visibility) |
106 | 108 | { |
107 | - if(!in_array($visibility, JSONWebKeyVisibility::$valid_values)) |
|
108 | - throw new InvalidJWKVisibilityException; |
|
109 | + if(!in_array($visibility, JSONWebKeyVisibility::$valid_values)) { |
|
110 | + throw new InvalidJWKVisibilityException; |
|
111 | + } |
|
109 | 112 | $this->visibility = $visibility; |
110 | 113 | return $this; |
111 | 114 | } |
@@ -187,7 +190,9 @@ discard block |
||
187 | 190 | */ |
188 | 191 | protected function checkX509CertMismatch(){ |
189 | 192 | $x509 = $this->getX509LeafCertificate(); |
190 | - if(is_null($x509)) return false; |
|
193 | + if(is_null($x509)) { |
|
194 | + return false; |
|
195 | + } |
|
191 | 196 | $ppk1 = $x509->getPublicKey(); |
192 | 197 | $ppk2 = $this->public_key->getStrippedEncoded(); |
193 | 198 | return $ppk1 !== $ppk2 ; |
@@ -77,7 +77,9 @@ |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | $res = $this->rsa_imp->loadKey($this->pem_format, RSA::PRIVATE_FORMAT_PKCS1); |
80 | - if(!$res) throw new RSABadPEMFormat(sprintf('pem %s',$pem_format )); |
|
80 | + if(!$res) { |
|
81 | + throw new RSABadPEMFormat(sprintf('pem %s',$pem_format )); |
|
82 | + } |
|
81 | 83 | |
82 | 84 | $this->key = PublicKeyLoader::load($this->pem_format, $this->password)->toString('raw'); |
83 | 85 |
@@ -36,8 +36,9 @@ |
||
36 | 36 | |
37 | 37 | parent::__construct($pem_format, $password); |
38 | 38 | $this->d = $this->key['d']; |
39 | - if($this->d->toString() === $this->e->toString()) |
|
40 | - throw new RSABadPEMFormat(sprintf('pem %s is a public key!', $pem_format)); |
|
39 | + if($this->d->toString() === $this->e->toString()) { |
|
40 | + throw new RSABadPEMFormat(sprintf('pem %s is a public key!', $pem_format)); |
|
41 | + } |
|
41 | 42 | } |
42 | 43 | |
43 | 44 | /** |