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/security/x509/_X509Certificate.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     /**
24 24
      * @var array
25 25
      */
26
-    private $info  = [];
26
+    private $info = [];
27 27
 
28 28
     /**
29 29
      * @var X509|null
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
      */
36 36
     private $original_pem = null;
37 37
 
38
-    public function __construct($pem){
38
+    public function __construct($pem) {
39 39
 
40 40
         $this->file = new X509();
41 41
         $this->info = $this->file->loadX509($pem);
42
-        if($this->info === false) throw new InvalidX509CertificateException($pem);
42
+        if ($this->info === false) throw new InvalidX509CertificateException($pem);
43 43
         $this->original_pem = $pem;
44 44
     }
45 45
 
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
        return $this->original_pem;
52 52
     }
53 53
 
54
-    private function calculateThumbprint($alg){
55
-        $pem = str_replace( array("\n","\r"), '', trim($this->original_pem));
54
+    private function calculateThumbprint($alg) {
55
+        $pem = str_replace(array("\n", "\r"), '', trim($this->original_pem));
56 56
         return strtoupper(hash($alg, base64_decode($pem)));
57 57
     }
58 58
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
     public function getPublicKey()
79 79
     {
80 80
         $pem = (string)$this->file->getPublicKey();
81
-        $pem = preg_replace('/\-+BEGIN PUBLIC KEY\-+/','',$pem);
82
-        $pem = preg_replace('/\-+END PUBLIC KEY\-+/','',$pem);
83
-        $pem = str_replace( array("\n","\r","\t"), '', trim($pem));
81
+        $pem = preg_replace('/\-+BEGIN PUBLIC KEY\-+/', '', $pem);
82
+        $pem = preg_replace('/\-+END PUBLIC KEY\-+/', '', $pem);
83
+        $pem = str_replace(array("\n", "\r", "\t"), '', trim($pem));
84 84
         return $pem;
85 85
     }
86 86
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@
 block discarded – undo
39 39
 
40 40
         $this->file = new X509();
41 41
         $this->info = $this->file->loadX509($pem);
42
-        if($this->info === false) throw new InvalidX509CertificateException($pem);
42
+        if($this->info === false) {
43
+         throw new InvalidX509CertificateException($pem);
44
+        }
43 45
         $this->original_pem = $pem;
44 46
     }
45 47
 
Please login to merge, or discard this patch.
src/security/KeyPair.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @param PublicKey $public_key
33 33
      * @param PrivateKey $private_key
34 34
      */
35
-    public function __construct(PublicKey $public_key, PrivateKey $private_key){
35
+    public function __construct(PublicKey $public_key, PrivateKey $private_key) {
36 36
 
37 37
         $this->private_key = $private_key;
38 38
         $this->public_key  = $public_key;
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
     /**
42 42
      * @return PublicKey
43 43
      */
44
-    public function getPublic(){ return $this->public_key; }
44
+    public function getPublic() { return $this->public_key; }
45 45
 
46 46
     /**
47 47
      * @return PrivateKey
48 48
      */
49
-    public function getPrivate(){ return $this->private_key; }
49
+    public function getPrivate() { return $this->private_key; }
50 50
 
51 51
 }
52 52
\ No newline at end of file
Please login to merge, or discard this patch.
src/security/rsa/_AbstractRSAKeyPEMFornat.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,17 +40,17 @@
 block discarded – undo
40 40
      * @param string $password
41 41
      * @throws RSABadPEMFormat
42 42
      */
43
-    public function __construct($pem_format, $password = null){
43
+    public function __construct($pem_format, $password = null) {
44 44
 
45 45
         $this->pem_format = $pem_format;
46 46
         $this->rsa_imp    = new RSA();
47 47
 
48
-        if(!empty($password))
48
+        if (!empty($password))
49 49
             $this->rsa_imp->setPassword($password);
50 50
 
51 51
         $res = $this->rsa_imp->loadKey($this->pem_format, RSA::PRIVATE_FORMAT_PKCS1);
52 52
 
53
-        if(!$res) throw new RSABadPEMFormat(sprintf('pem %s',$pem_format ));
53
+        if (!$res) throw new RSABadPEMFormat(sprintf('pem %s', $pem_format));
54 54
 
55 55
         $this->n = $this->rsa_imp->modulus;
56 56
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,12 +45,15 @@
 block discarded – undo
45 45
         $this->pem_format = $pem_format;
46 46
         $this->rsa_imp    = new RSA();
47 47
 
48
-        if(!empty($password))
49
-            $this->rsa_imp->setPassword($password);
48
+        if(!empty($password)) {
49
+                    $this->rsa_imp->setPassword($password);
50
+        }
50 51
 
51 52
         $res = $this->rsa_imp->loadKey($this->pem_format, RSA::PRIVATE_FORMAT_PKCS1);
52 53
 
53
-        if(!$res) throw new RSABadPEMFormat(sprintf('pem %s',$pem_format ));
54
+        if(!$res) {
55
+         throw new RSABadPEMFormat(sprintf('pem %s',$pem_format ));
56
+        }
54 57
 
55 58
         $this->n = $this->rsa_imp->modulus;
56 59
     }
Please login to merge, or discard this patch.
src/security/rsa/_RSAPrivateKeyPEMFornat.php 1 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/rsa/_RSAPublicKeyPEMFornat.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  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
         parent::__construct($pem_format, $password);
37 37
         $this->e = $this->rsa_imp->publicExponent;
38 38
     }
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
     public function getEncoded()
61 61
     {
62 62
         $pem = $this->rsa_imp->getPublicKey(RSA::PUBLIC_FORMAT_PKCS8);
63
-        $pem = preg_replace('/\-+BEGIN PUBLIC KEY\-+/','',$pem);
64
-        $pem = preg_replace('/\-+END PUBLIC KEY\-+/','',$pem);
65
-        $pem = str_replace( array("\n","\r","\t"), '', trim($pem));
63
+        $pem = preg_replace('/\-+BEGIN PUBLIC KEY\-+/', '', $pem);
64
+        $pem = preg_replace('/\-+END PUBLIC KEY\-+/', '', $pem);
65
+        $pem = str_replace(array("\n", "\r", "\t"), '', trim($pem));
66 66
         return $pem;
67 67
     }
68 68
 
Please login to merge, or discard this patch.
src/security/rsa/RSAFacade.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
      */
32 32
     private $rsa_imp;
33 33
 
34
-    private function __construct(){
34
+    private function __construct() {
35 35
         $this->rsa_imp = new RSA();
36 36
     }
37 37
 
38
-    private function __clone(){}
38
+    private function __clone() {}
39 39
 
40 40
     /**
41 41
      * @return RSAFacade
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 RSAFacade();
46 46
         }
47 47
         return self::$instance;
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
      * @param $bits
52 52
      * @return KeyPair
53 53
      */
54
-    public function buildKeyPair($bits){
54
+    public function buildKeyPair($bits) {
55 55
         $this->rsa_imp->setPrivateKeyFormat(RSA::PRIVATE_FORMAT_PKCS1);
56 56
         $this->rsa_imp->setPublicKeyFormat(RSA::PUBLIC_FORMAT_PKCS1);
57 57
 
58 58
         $list = $this->rsa_imp->createKey($bits);
59
-        return new KeyPair( new _RSAPublicKeyPEMFornat($list['publickey']), new _RSAPrivateKeyPEMFornat($list['privatekey']));
59
+        return new KeyPair(new _RSAPublicKeyPEMFornat($list['publickey']), new _RSAPrivateKeyPEMFornat($list['privatekey']));
60 60
     }
61 61
 
62 62
     /**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param BigInteger $e
65 65
      * @return RSAPublicKey
66 66
      */
67
-    public function buildPublicKey(BigInteger $n, BigInteger $e){
67
+    public function buildPublicKey(BigInteger $n, BigInteger $e) {
68 68
         $public_key_pem = $this->rsa_imp->_convertPublicKey($n, $e);
69 69
         return new _RSAPublicKeyPEMFornat($public_key_pem);
70 70
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * @param \Math_BigInteger $d
75 75
      * @return RSAPrivateKey
76 76
      */
77
-    public function buildMinimalPrivateKey(\Math_BigInteger $n, \Math_BigInteger $d){
77
+    public function buildMinimalPrivateKey(\Math_BigInteger $n, \Math_BigInteger $d) {
78 78
         $this->rsa_imp->modulus = $n;
79 79
         $this->rsa_imp->exponent = $d;
80 80
         $private_key_pem = $this->rsa_imp->_getPrivatePublicKey();
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                                     BigInteger $q,
100 100
                                     BigInteger $dp,
101 101
                                     BigInteger $dq,
102
-                                    BigInteger $qi){
102
+                                    BigInteger $qi) {
103 103
 
104 104
         $private_key_pem = $this->rsa_imp->_convertPrivateKey(
105 105
             $n,
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      * @return RSAPrivateKey
119 119
      * @throws RSABadPEMFormat
120 120
      */
121
-    public function buildPrivateKeyFromPEM($private_key_pem, $password = null){
121
+    public function buildPrivateKeyFromPEM($private_key_pem, $password = null) {
122 122
        return new _RSAPrivateKeyPEMFornat($private_key_pem, $password);
123 123
     }
124 124
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      * @return RSAPublicKey
128 128
      * @throws RSABadPEMFormat
129 129
      */
130
-    public function buildPublicKeyFromPEM($public_key_pem){
130
+    public function buildPublicKeyFromPEM($public_key_pem) {
131 131
         return new _RSAPublicKeyPEMFornat($public_key_pem);
132 132
     }
133 133
 
Please login to merge, or discard this patch.