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
Pull Request — master (#6)
by sebastian
03:05
created
src/jwe/JWEFactory.php 2 patches
Spacing   +11 added lines, -16 removed lines patch added patch discarded remove patch
@@ -37,41 +37,36 @@  discard block
 block discarded – undo
37 37
     static public function build(IJWE_Specification $spec)
38 38
     {
39 39
 
40
-        if($spec instanceof IJWE_ParamsSpecification)
40
+        if ($spec instanceof IJWE_ParamsSpecification)
41 41
         {
42 42
 
43
-            if($spec->getRecipientKey()->getKeyUse()->getString() !== JSONWebKeyPublicKeyUseValues::Encryption)
44
-                throw new InvalidJWKType
45
-                (
46
-                    sprintf
47
-                    (
43
+            if ($spec->getRecipientKey()->getKeyUse()->getString() !== JSONWebKeyPublicKeyUseValues::Encryption)
44
+                throw new InvalidJWKType(
45
+                    sprintf(
48 46
                         'use %s not supported (should be "enc")',
49 47
                         $spec->getRecipientKey()->getKeyUse()->getString()
50 48
                     )
51 49
                 );
52 50
 
53
-            if($spec->getAlg()->getString() !== $spec->getRecipientKey()->getAlgorithm()->getString())
54
-                throw new InvalidJWKAlgorithm
55
-                (
56
-                    sprintf
57
-                    (
51
+            if ($spec->getAlg()->getString() !== $spec->getRecipientKey()->getAlgorithm()->getString())
52
+                throw new InvalidJWKAlgorithm(
53
+                    sprintf(
58 54
                         'mismatch between algorithm intended for use with the key %s and the cryptographic algorithm used to encrypt or determine the value of the CEK %s',
59 55
                         $spec->getAlg()->getString(),
60 56
                         $spec->getRecipientKey()->getAlgorithm()->getString()
61 57
                     )
62 58
                 );
63 59
 
64
-            $header = new JWEJOSEHeader
65
-            (
60
+            $header = new JWEJOSEHeader(
66 61
                 $spec->getAlg(),
67 62
                 $spec->getEnc(),
68 63
                 $spec->getRecipientKey()->getId()
69 64
             );
70 65
 
71 66
             //set zip alg
72
-            $zip    = $spec->getZip();
67
+            $zip = $spec->getZip();
73 68
 
74
-            if(!is_null($zip))
69
+            if (!is_null($zip))
75 70
                 $header->setCompressionAlgorithm($zip);
76 71
 
77 72
             $jwe = JWE::fromHeaderAndPayload($header, $spec->getPayload());
@@ -81,7 +76,7 @@  discard block
 block discarded – undo
81 76
             return $jwe;
82 77
         }
83 78
 
84
-        if($spec instanceof IJWE_CompactFormatSpecification)
79
+        if ($spec instanceof IJWE_CompactFormatSpecification)
85 80
         {
86 81
             return JWE::fromCompactSerialization($spec->getCompactFormat());
87 82
         }
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
         if($spec instanceof IJWE_ParamsSpecification)
41 41
         {
42 42
 
43
-            if($spec->getRecipientKey()->getKeyUse()->getString() !== JSONWebKeyPublicKeyUseValues::Encryption)
44
-                throw new InvalidJWKType
43
+            if($spec->getRecipientKey()->getKeyUse()->getString() !== JSONWebKeyPublicKeyUseValues::Encryption) {
44
+                            throw new InvalidJWKType
45 45
                 (
46 46
                     sprintf
47 47
                     (
@@ -49,9 +49,10 @@  discard block
 block discarded – undo
49 49
                         $spec->getRecipientKey()->getKeyUse()->getString()
50 50
                     )
51 51
                 );
52
+            }
52 53
 
53
-            if($spec->getAlg()->getString() !== $spec->getRecipientKey()->getAlgorithm()->getString())
54
-                throw new InvalidJWKAlgorithm
54
+            if($spec->getAlg()->getString() !== $spec->getRecipientKey()->getAlgorithm()->getString()) {
55
+                            throw new InvalidJWKAlgorithm
55 56
                 (
56 57
                     sprintf
57 58
                     (
@@ -60,6 +61,7 @@  discard block
 block discarded – undo
60 61
                         $spec->getRecipientKey()->getAlgorithm()->getString()
61 62
                     )
62 63
                 );
64
+            }
63 65
 
64 66
             $header = new JWEJOSEHeader
65 67
             (
@@ -71,8 +73,9 @@  discard block
 block discarded – undo
71 73
             //set zip alg
72 74
             $zip    = $spec->getZip();
73 75
 
74
-            if(!is_null($zip))
75
-                $header->setCompressionAlgorithm($zip);
76
+            if(!is_null($zip)) {
77
+                            $header->setCompressionAlgorithm($zip);
78
+            }
76 79
 
77 80
             $jwe = JWE::fromHeaderAndPayload($header, $spec->getPayload());
78 81
 
Please login to merge, or discard this patch.
src/jwe/compression_algorithms/CompressionAlgorithms_Registry.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,9 @@
 block discarded – undo
64 64
      * @return null|CompressionAlgorithm
65 65
      */
66 66
     public function get($alg){
67
-        if(!$this->isSupported($alg)) return null;
67
+        if(!$this->isSupported($alg)) {
68
+         return null;
69
+        }
68 70
         return $this->algorithms[$alg];
69 71
     }
70 72
 }
71 73
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
     private $algorithms = [];
29 29
 
30
-    private function __construct(){
30
+    private function __construct() {
31 31
 
32 32
         $this->algorithms[CompressionAlgorithmsNames::Deflate] = new Deflate;
33 33
         $this->algorithms[CompressionAlgorithmsNames::GZip]    = new GZip;
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
 
36 36
     }
37 37
 
38
-    private function __clone(){}
38
+    private function __clone() {}
39 39
 
40 40
     /**
41 41
      * @return CompressionAlgorithms_Registry
42 42
      */
43
-    public static function getInstance(){
44
-        if(!is_object(self::$instance)){
43
+    public static function getInstance() {
44
+        if (!is_object(self::$instance)) {
45 45
             self::$instance = new CompressionAlgorithms_Registry();
46 46
         }
47 47
         return self::$instance;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @param string $alg
52 52
      * @return bool
53 53
      */
54
-    public function isSupported($alg){
54
+    public function isSupported($alg) {
55 55
         return array_key_exists($alg, $this->algorithms);
56 56
     }
57 57
 
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
      * @param $alg
60 60
      * @return null|CompressionAlgorithm
61 61
      */
62
-    public function get($alg){
63
-        if(!$this->isSupported($alg)) return null;
62
+    public function get($alg) {
63
+        if (!$this->isSupported($alg)) return null;
64 64
         return $this->algorithms[$alg];
65 65
     }
66 66
 }
67 67
\ No newline at end of file
Please login to merge, or discard this patch.
src/security/SymmetricSharedKey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     /**
28 28
      * @param string $secret
29 29
      */
30
-    public function __construct($secret){
30
+    public function __construct($secret) {
31 31
         $this->secret = $secret;
32 32
     }
33 33
 
Please login to merge, or discard this patch.
src/security/rsa/_RSAPrivateKeyPEMFornat.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@
 block discarded – undo
37 37
 
38 38
         parent::__construct($pem_format, $password);
39 39
         $this->d = $this->rsa_imp->exponent;
40
-        if($this->d->toString() === $this->e->toString())
41
-            throw new RSABadPEMFormat(sprintf('pem %s is a public key!', $pem_format));
40
+        if($this->d->toString() === $this->e->toString()) {
41
+                    throw new RSABadPEMFormat(sprintf('pem %s is a public key!', $pem_format));
42
+        }
42 43
     }
43 44
 
44 45
     /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
      * @param string $password
33 33
      * @throws RSABadPEMFormat
34 34
      */
35
-    public function __construct($pem_format, $password = null){
35
+    public function __construct($pem_format, $password = null) {
36 36
 
37 37
         parent::__construct($pem_format, $password);
38 38
         $this->d = $this->rsa_imp->exponent;
39
-        if($this->d->toString() === $this->e->toString())
39
+        if ($this->d->toString() === $this->e->toString())
40 40
             throw new RSABadPEMFormat(sprintf('pem %s is a public key!', $pem_format));
41 41
     }
42 42
 
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
     public function getEncoded()
57 57
     {
58 58
         $pem = $this->rsa_imp->getPrivateKey(RSA::PUBLIC_FORMAT_PKCS1);
59
-        $pem = preg_replace('/\-+BEGIN RSA PRIVATE KEY\-+/','',$pem);
60
-        $pem = preg_replace('/\-+END RSA PRIVATE KEY\-+/','',$pem);
61
-        $pem = str_replace( array("\n","\r","\t"), '', trim($pem));
59
+        $pem = preg_replace('/\-+BEGIN RSA PRIVATE KEY\-+/', '', $pem);
60
+        $pem = preg_replace('/\-+END RSA PRIVATE KEY\-+/', '', $pem);
61
+        $pem = str_replace(array("\n", "\r", "\t"), '', trim($pem));
62 62
         return $pem;
63 63
     }
64 64
 
Please login to merge, or discard this patch.
src/security/x509/X509CertificateFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      * @param string $pem
25 25
      * @return X509Certificate
26 26
      */
27
-    static public function buildFromPEM($pem){
27
+    static public function buildFromPEM($pem) {
28 28
         return new _X509Certificate($pem);
29 29
     }
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
src/jwk/IJWK.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
  * Interface IJWK
23 23
  * @package jwk
24 24
  */
25
-interface IJWK extends IReadOnlyJWK  {
25
+interface IJWK extends IReadOnlyJWK {
26 26
 
27 27
     /**
28 28
      * @param  string $kid
Please login to merge, or discard this patch.
src/jwk/RSAKeysParameters.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     const Exponent = 'e';
37 37
 
38
-    public static $public_key_params = array ( self::Modulus, self::Exponent);
38
+    public static $public_key_params = array(self::Modulus, self::Exponent);
39 39
 
40 40
     /**
41 41
      * The "d" (private exponent) parameter contains the private exponent
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
 
81 81
 
82
-    public static $producers_private_key_params = array (
82
+    public static $producers_private_key_params = array(
83 83
         self::FirstPrimeFactor,
84 84
         self::SecondPrimeFactor,
85 85
         self::FirstFactorCRTExponent,
Please login to merge, or discard this patch.
src/jwk/impl/OctetSequenceJWK.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
     protected function __construct(Key $secret, $headers = array())
41 41
     {
42 42
 
43
-        if(empty($secret))
43
+        if (empty($secret))
44 44
             throw new InvalidOctetSequenceJWKException('secret is not set!.');
45 45
 
46 46
         $this->set[JSONWebKeyParameters::KeyType] = new StringOrURI(JSONWebKeyTypes::OctetSequence);
47 47
 
48 48
         parent::__construct($headers);
49 49
 
50
-        if(count($headers) === 0 ) return;
50
+        if (count($headers) === 0) return;
51 51
 
52 52
         $b64 = new Base64UrlRepresentation();
53 53
 
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
      * @param string $use
73 73
      * @return IJWK
74 74
      */
75
-    static public function fromSecret(Key $key, $alg = null, $use = JSONWebKeyPublicKeyUseValues::Signature){
75
+    static public function fromSecret(Key $key, $alg = null, $use = JSONWebKeyPublicKeyUseValues::Signature) {
76 76
 
77 77
         $headers = array();
78 78
 
79
-        if(!empty($alg)) {
79
+        if (!empty($alg)) {
80 80
 
81 81
             $headers[JSONWebKeyParameters::Algorithm] = $alg;
82 82
         }
83 83
 
84 84
         $headers[JSONWebKeyParameters::PublicKeyUse] = $use;
85 85
 
86
-        return new OctetSequenceJWK($key, $headers) ;
86
+        return new OctetSequenceJWK($key, $headers);
87 87
     }
88 88
 }
89 89
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,14 +40,17 @@
 block discarded – undo
40 40
     protected function __construct(Key $secret, $headers = array())
41 41
     {
42 42
 
43
-        if(empty($secret))
44
-            throw new InvalidOctetSequenceJWKException('secret is not set!.');
43
+        if(empty($secret)) {
44
+                    throw new InvalidOctetSequenceJWKException('secret is not set!.');
45
+        }
45 46
 
46 47
         $this->set[JSONWebKeyParameters::KeyType] = new StringOrURI(JSONWebKeyTypes::OctetSequence);
47 48
 
48 49
         parent::__construct($headers);
49 50
 
50
-        if(count($headers) === 0 ) return;
51
+        if(count($headers) === 0 ) {
52
+         return;
53
+        }
51 54
 
52 55
         $b64 = new Base64UrlRepresentation();
53 56
 
Please login to merge, or discard this patch.
src/jwk/impl/JWKSpecification.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,8 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param string $use
47 47
      * @param null|string $kid
48 48
      */
49
-    public function __construct
50
-    (
49
+    public function __construct(
51 50
         $alg = JSONWebSignatureAndEncryptionAlgorithms::RS256,
52 51
         $use = JSONWebKeyPublicKeyUseValues::Signature,
53 52
         $kid = null
@@ -58,7 +57,7 @@  discard block
 block discarded – undo
58 57
         $this->kid  = $kid;
59 58
     }
60 59
 
61
-    public function getAlg(){
60
+    public function getAlg() {
62 61
         return $this->alg;
63 62
     }
64 63
 
Please login to merge, or discard this patch.