@@ -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 ; |
@@ -36,8 +36,9 @@ |
||
| 36 | 36 | |
| 37 | 37 | parent::__construct($pem_format, $password); |
| 38 | 38 | $this->d = $this->key->getPrivateExponent(); |
| 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 | /** |
@@ -74,7 +74,9 @@ |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $res = $this->rsa_imp->loadKey($this->pem_format, RSA::PRIVATE_FORMAT_PKCS1); |
| 77 | - if(!$res) throw new RSABadPEMFormat(sprintf('pem %s',$pem_format )); |
|
| 77 | + if(!$res) { |
|
| 78 | + throw new RSABadPEMFormat(sprintf('pem %s',$pem_format )); |
|
| 79 | + } |
|
| 78 | 80 | $this->key = new CustomAsymmetricKey(PublicKeyLoader::load($this->pem_format, $this->password)); |
| 79 | 81 | } |
| 80 | 82 | |