GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch master (356550)
by sebastian
02:47
created
src/jwk/impl/RSAJWKParamsPublicKeySpecification.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,42 +92,42 @@
 block discarded – undo
92 92
     /**
93 93
      * @return Base64urlUInt
94 94
      */
95
-    public function getModulus(){
95
+    public function getModulus() {
96 96
         return new Base64urlUInt($this->n_b64);
97 97
     }
98 98
 
99 99
     /**
100 100
      * @return Base64urlUInt
101 101
      */
102
-    public function getExponent(){
102
+    public function getExponent() {
103 103
         return new Base64urlUInt($this->e_b64);
104 104
     }
105 105
 
106 106
     /**
107 107
      * @return array
108 108
      */
109
-    public function getX509CertificateChain(){
109
+    public function getX509CertificateChain() {
110 110
         return $this->x5c;
111 111
     }
112 112
 
113 113
     /**
114 114
      * @return null|string
115 115
      */
116
-    public function getX509Url(){
116
+    public function getX509Url() {
117 117
         return $this->x5u;
118 118
     }
119 119
 
120 120
     /**
121 121
      * @return null|string
122 122
      */
123
-    public function getX509CertificateSHA_1_Thumbprint(){
123
+    public function getX509CertificateSHA_1_Thumbprint() {
124 124
         return $this->x5t;
125 125
     }
126 126
 
127 127
     /**
128 128
      * @return null|string
129 129
      */
130
-    public function getX509CertificateSHA_256_Thumbprint(){
130
+    public function getX509CertificateSHA_256_Thumbprint() {
131 131
         return $this->x5t_S256;
132 132
     }
133 133
 }
134 134
\ No newline at end of file
Please login to merge, or discard this patch.
src/jwk/impl/RSAJWKPEMKeySpecification.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@
 block discarded – undo
34 34
      * @param string $alg
35 35
      * @param string $use
36 36
      */
37
-    public function __construct
38
-    (
37
+    public function __construct(
39 38
         $key_pem,
40 39
         $alg = JSONWebSignatureAndEncryptionAlgorithms::RS256,
41 40
         $use = JSONWebKeyPublicKeyUseValues::Signature
Please login to merge, or discard this patch.
src/jwk/impl/RSAJWKSpecification.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,14 +32,13 @@
 block discarded – undo
32 32
      * @param string $kid
33 33
      * @throws InvalidJWKAlgorithm
34 34
      */
35
-    public function __construct
36
-    (
35
+    public function __construct(
37 36
         $alg = JSONWebSignatureAndEncryptionAlgorithms::RS256,
38 37
         $use = JSONWebKeyPublicKeyUseValues::Signature,
39 38
         $kid = null
40 39
     )
41 40
     {
42
-        if(!empty($alg) && !in_array($alg, RSAKeysParameters::$valid_algorithms_values))
41
+        if (!empty($alg) && !in_array($alg, RSAKeysParameters::$valid_algorithms_values))
43 42
             throw new InvalidJWKAlgorithm(sprintf('alg %s', $alg));
44 43
 
45 44
         parent::__construct($alg, $use, $kid);
Please login to merge, or discard this patch.
src/jwk/impl/OctetSequenceJWKSpecification.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,14 +38,13 @@
 block discarded – undo
38 38
      * @param string $use
39 39
      * @throws InvalidJWKAlgorithm
40 40
      */
41
-    public function __construct
42
-    (
41
+    public function __construct(
43 42
         $shared_secret = self::GenerateSecret,
44 43
         $alg = JSONWebSignatureAndEncryptionAlgorithms::HS256,
45 44
         $use = JSONWebKeyPublicKeyUseValues::Signature
46 45
     )
47 46
     {
48
-        if(!in_array($alg, OctetSequenceKeysParameters::$valid_algorithms_values))
47
+        if (!in_array($alg, OctetSequenceKeysParameters::$valid_algorithms_values))
49 48
             throw new InvalidJWKAlgorithm(sprintf('alg %s', $alg));
50 49
 
51 50
         parent::__construct($alg, $use);
Please login to merge, or discard this patch.
src/jwk/impl/RSAJWK.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
      */
113 113
     static public function fromKeys(KeyPair $keys)
114 114
     {
115
-        if(!($keys->getPrivate() instanceof RSAPrivateKey))
115
+        if (!($keys->getPrivate() instanceof RSAPrivateKey))
116 116
             throw new \RuntimeException('Private key of invalid type!');
117 117
 
118
-        if(!($keys->getPublic() instanceof RSAPublicKey))
118
+        if (!($keys->getPublic() instanceof RSAPublicKey))
119 119
             throw new \RuntimeException('Public key of invalid type!');
120 120
 
121 121
         $jwk                                          = new RSAJWK();
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function getKey($key_op = JSONWebKeyKeyOperationsValues::ComputeDigitalSignatureOrMAC)
167 167
     {
168
-        switch($key_op){
168
+        switch ($key_op) {
169 169
             case JSONWebKeyKeyOperationsValues::ComputeDigitalSignatureOrMAC:
170 170
             case JSONWebKeyKeyOperationsValues::DecryptContentAndValidateDecryption: {
171 171
                 return $this->getPrivateKey();
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             }
178 178
             break;
179 179
             default:{
180
-                throw new InvalidJWKUseException(sprintf('key_op %s',  $key_op));
180
+                throw new InvalidJWKUseException(sprintf('key_op %s', $key_op));
181 181
             }
182 182
             break;
183 183
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     public function toArray()
191 191
     {
192 192
         $res = parent::toArray();
193
-        if($this->visibility === JSONWebKeyVisibility::PublicOnly){
193
+        if ($this->visibility === JSONWebKeyVisibility::PublicOnly) {
194 194
             //remove private attributes
195 195
             unset($res[RSAKeysParameters::PrivateExponent]);
196 196
             unset($res[RSAKeysParameters::FirstPrimeFactor]);
Please login to merge, or discard this patch.
src/jwk/impl/AsymmetricJWK.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -63,33 +63,33 @@  discard block
 block discarded – undo
63 63
     {
64 64
         parent::__construct($headers);
65 65
 
66
-        if(count($headers) === 0 ) return;
66
+        if (count($headers) === 0) return;
67 67
 
68 68
         // certificates
69
-        if(in_array(PublicJSONWebKeyParameters::X_509CertificateChain, $headers) && is_array($headers[PublicJSONWebKeyParameters::X_509CertificateChain])){
69
+        if (in_array(PublicJSONWebKeyParameters::X_509CertificateChain, $headers) && is_array($headers[PublicJSONWebKeyParameters::X_509CertificateChain])) {
70 70
 
71 71
             // json array
72
-            foreach($headers[PublicJSONWebKeyParameters::X_509CertificateChain] as $x509_pem){
72
+            foreach ($headers[PublicJSONWebKeyParameters::X_509CertificateChain] as $x509_pem) {
73 73
                 array_push($this->x509_certificates_chain, X509CertificateFactory::buildFromPEM($x509_pem));
74 74
 
75 75
             }
76 76
 
77
-            if($this->checkX509CertMismatch()){
77
+            if ($this->checkX509CertMismatch()) {
78 78
                 throw new X509CertMismatchException;
79 79
             }
80 80
 
81 81
             $this->set[PublicJSONWebKeyParameters::X_509CertificateChain] = new JsonArray($headers[PublicJSONWebKeyParameters::X_509CertificateChain]);
82 82
         }
83 83
 
84
-        if(in_array(PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint, $headers)){
85
-            $this->set[PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint] = new StringOrURI($headers[PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint]) ;
84
+        if (in_array(PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint, $headers)) {
85
+            $this->set[PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint] = new StringOrURI($headers[PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint]);
86 86
         }
87 87
 
88
-        if(in_array(PublicJSONWebKeyParameters::X_509CertificateSHA_256_Thumbprint, $headers)){
88
+        if (in_array(PublicJSONWebKeyParameters::X_509CertificateSHA_256_Thumbprint, $headers)) {
89 89
             $this->set[PublicJSONWebKeyParameters::X_509CertificateSHA_256_Thumbprint] = new StringOrURI($headers[PublicJSONWebKeyParameters::X_509CertificateSHA_256_Thumbprint]);
90 90
         }
91 91
 
92
-        if(in_array(PublicJSONWebKeyParameters::X_509Url, $headers)){
92
+        if (in_array(PublicJSONWebKeyParameters::X_509Url, $headers)) {
93 93
             $this->set[PublicJSONWebKeyParameters::X_509Url] = new StringOrURI($headers[PublicJSONWebKeyParameters::X_509Url]);
94 94
         }
95 95
     }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function setVisibility($visibility)
111 111
     {
112
-        if(!in_array($visibility, JSONWebKeyVisibility::$valid_values))
112
+        if (!in_array($visibility, JSONWebKeyVisibility::$valid_values))
113 113
             throw new InvalidJWKVisibilityException;
114 114
         $this->visibility = $visibility;
115 115
         return $this;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     /**
135 135
      * @return null | X509Certificate
136 136
      */
137
-    public function getX509LeafCertificate(){
137
+    public function getX509LeafCertificate() {
138 138
         return count($this->x509_certificates_chain) > 0 ? $this->x509_certificates_chain[0] : null;
139 139
     }
140 140
 
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function getX509CertificateSha1Thumbprint($fallback_on_x5c = false)
155 155
     {
156
-        $res = is_null($this[PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint])? null : $this[PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint]->getString();
157
-        if(empty($res) && $fallback_on_x5c){
156
+        $res = is_null($this[PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint]) ? null : $this[PublicJSONWebKeyParameters::X_509CertificateSHA_1_Thumbprint]->getString();
157
+        if (empty($res) && $fallback_on_x5c) {
158 158
             $x509 = $this->getX509LeafCertificate();
159
-            if(!is_null($x509)){
159
+            if (!is_null($x509)) {
160 160
                 return $x509->getSHA_1_Thumbprint();
161 161
             }
162 162
         }
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
      */
170 170
     public function getX509CertificateSha256Thumbprint($fallback_on_x5c = false)
171 171
     {
172
-        $res = is_null($this[PublicJSONWebKeyParameters::X_509CertificateSHA_256_Thumbprint])? null : $this[PublicJSONWebKeyParameters::X_509CertificateSHA_256_Thumbprint]->getString();
173
-        if(empty($res) && $fallback_on_x5c){
172
+        $res = is_null($this[PublicJSONWebKeyParameters::X_509CertificateSHA_256_Thumbprint]) ? null : $this[PublicJSONWebKeyParameters::X_509CertificateSHA_256_Thumbprint]->getString();
173
+        if (empty($res) && $fallback_on_x5c) {
174 174
             $x509 = $this->getX509LeafCertificate();
175
-            if(!is_null($x509)){
175
+            if (!is_null($x509)) {
176 176
                 return $x509->getSHA_256_Thumbprint();
177 177
             }
178 178
         }
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function getX509Url()
186 186
     {
187
-        return is_null($this[PublicJSONWebKeyParameters::X_509Url])? null : $this[PublicJSONWebKeyParameters::X_509Url]->getString();
187
+        return is_null($this[PublicJSONWebKeyParameters::X_509Url]) ? null : $this[PublicJSONWebKeyParameters::X_509Url]->getString();
188 188
     }
189 189
 
190 190
     /**
191 191
      * @return bool
192 192
      */
193
-    protected function checkX509CertMismatch(){
193
+    protected function checkX509CertMismatch() {
194 194
         $x509 = $this->getX509LeafCertificate();
195 195
         return !is_null($x509) && $x509->getPublicKey() !== $this->public_key->getEncoded();
196 196
     }
@@ -200,13 +200,13 @@  discard block
 block discarded – undo
200 200
      * @return $this
201 201
      * @throws X509CertMismatchException
202 202
      */
203
-    public function setX509CertificateChain(array $x5c){
203
+    public function setX509CertificateChain(array $x5c) {
204 204
         // json array
205
-        foreach($x5c as $x509_pem){
205
+        foreach ($x5c as $x509_pem) {
206 206
             array_push($this->x509_certificates_chain, X509CertificateFactory::buildFromPEM($x509_pem));
207 207
         }
208 208
 
209
-        if($this->checkX509CertMismatch()){
209
+        if ($this->checkX509CertMismatch()) {
210 210
             throw new X509CertMismatchException;
211 211
         }
212 212
 
Please login to merge, or discard this patch.
src/jwk/impl/JWK.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
      * @throws InvalidJWKType
41 41
      * @throws InvalidJWKUseException
42 42
      */
43
-    protected function __construct(array $headers = array()){
43
+    protected function __construct(array $headers = array()) {
44 44
 
45
-        if(count($headers) === 0 ) return;
45
+        if (count($headers) === 0) return;
46 46
 
47 47
         $alg = @$headers[JSONWebKeyParameters::Algorithm];
48 48
         $this->setAlgorithm($alg);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function setId($kid)
86 86
     {
87
-        if(!empty($kid))
87
+        if (!empty($kid))
88 88
             $this->set[JSONWebKeyParameters::KeyId] = new  JsonValue($kid);
89 89
         return $this;
90 90
     }
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function setAlgorithm($alg)
98 98
     {
99
-        if(!in_array($alg, JSONWebSignatureAndEncryptionAlgorithms::$header_location_alg))
100
-            throw new InvalidJWKAlgorithm (sprintf('alg %s', $alg));
99
+        if (!in_array($alg, JSONWebSignatureAndEncryptionAlgorithms::$header_location_alg))
100
+            throw new InvalidJWKAlgorithm(sprintf('alg %s', $alg));
101 101
 
102 102
         $this->set[JSONWebKeyParameters::Algorithm] = new StringOrURI($alg);
103 103
         return $this;
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function setKeyUse($use)
112 112
     {
113
-        if(empty($use)) return $this;
114
-        if(!in_array($use, JSONWebKeyPublicKeyUseValues::$valid_uses))
113
+        if (empty($use)) return $this;
114
+        if (!in_array($use, JSONWebKeyPublicKeyUseValues::$valid_uses))
115 115
             throw new InvalidJWKUseException(sprintf('use %s', $use));
116 116
 
117 117
         $this->set[JSONWebKeyParameters::PublicKeyUse] = new StringOrURI($use);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public function setType($type)
127 127
     {
128
-        if(!in_array($type, JSONWebKeyTypes::$valid_keys_set))
128
+        if (!in_array($type, JSONWebKeyTypes::$valid_keys_set))
129 129
             throw new InvalidJWKType(sprintf('use %s', $type));
130 130
 
131 131
         $this->set[JSONWebKeyParameters::KeyType] = new StringOrURI($type);
Please login to merge, or discard this patch.
src/jwk/JSONWebKeyVisibility.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
     /**
24 24
      *
25 25
      */
26
-    const PublicOnly       = 1;
26
+    const PublicOnly = 1;
27 27
     /**
28 28
      *
29 29
      */
30
-    const IncludePrivate   = 2;
30
+    const IncludePrivate = 2;
31 31
     /**
32 32
      *
33 33
      */
@@ -36,5 +36,5 @@  discard block
 block discarded – undo
36 36
     /**
37 37
      * @var array
38 38
      */
39
-    static public $valid_values = array ( self::IncludePrivate, self::IncludeSymmetric, self::PublicOnly);
39
+    static public $valid_values = array(self::IncludePrivate, self::IncludeSymmetric, self::PublicOnly);
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
src/jwk/JSONWebKeyPublicKeyUseValues.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@
 block discarded – undo
29 29
     /**
30 30
      *
31 31
      */
32
-    const Signature  = 'sig';
32
+    const Signature = 'sig';
33 33
     /**
34 34
      *
35 35
      */
36 36
     const Encryption = 'enc';
37 37
 
38
-    public static $valid_uses = array ( self::Signature, self::Encryption);
38
+    public static $valid_uses = array(self::Signature, self::Encryption);
39 39
 }
40 40
\ No newline at end of file
Please login to merge, or discard this patch.