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 (#30)
by Alex
01:44
created
src/Certificate.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -150,6 +150,9 @@
 block discarded – undo
150 150
         return "-----BEGIN {$type}-----\n{$pem}-----END {$type}-----\n";
151 151
     }
152 152
 
153
+    /**
154
+     * @param \Closure $callable
155
+     */
153 156
     protected function guardAgainstUserErrorsFromPhpSeclib($callable)
154 157
     {
155 158
         set_error_handler(function ($errno, $errstr, $errfile, $errline) {
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace Spatie\CertificateChain;
4 4
 
5
+use Spatie\CertificateChain\Exceptions\CouldNotCreateCertificate;
6
+use Spatie\CertificateChain\Exceptions\CouldNotLoadCertificate;
5 7
 use phpseclib\File\ASN1;
6 8
 use phpseclib\File\X509;
7
-use Spatie\CertificateChain\Exceptions\CouldNotLoadCertificate;
8
-use Spatie\CertificateChain\Exceptions\CouldNotCreateCertificate;
9 9
 
10 10
 class Certificate
11 11
 {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $certificate = $contents;
46 46
 
47 47
         // If we are missing the pem certificate header, try to convert it to a pem format first
48
-        if (! empty($contents) && strpos($contents, '-----BEGIN CERTIFICATE-----') === false) {
48
+        if (!empty($contents) && strpos($contents, '-----BEGIN CERTIFICATE-----') === false) {
49 49
             // Extract from either a PKCS#7 format or DER formatted contents
50 50
             $certificate = self::convertPkcs72Pem($contents) ?? self::convertDer2Pem($contents);
51 51
         }
@@ -88,21 +88,21 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function hasParentInTrustChain(): bool
90 90
     {
91
-        return ! $this->getParentCertificateUrl() == '';
91
+        return !$this->getParentCertificateUrl() == '';
92 92
     }
93 93
 
94 94
     public function getContents(): string
95 95
     {
96
-        return $this->guardAgainstUserErrorsFromPhpSeclib(function () {
96
+        return $this->guardAgainstUserErrorsFromPhpSeclib(function() {
97 97
             $x509 = new X509();
98 98
 
99
-            return $x509->saveX509($x509->loadX509($this->contents)) . PHP_EOL;
99
+            return $x509->saveX509($x509->loadX509($this->contents)).PHP_EOL;
100 100
         });
101 101
     }
102 102
 
103 103
     protected function guardAgainstInvalidContents(string $content, string $original)
104 104
     {
105
-        if (! (new X509())->loadX509($content)) {
105
+        if (!(new X509())->loadX509($content)) {
106 106
             throw CouldNotCreateCertificate::invalidContent($original);
107 107
         }
108 108
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
     protected function guardAgainstUserErrorsFromPhpSeclib($callable)
154 154
     {
155
-        set_error_handler(function ($errno, $errstr, $errfile, $errline) {
155
+        set_error_handler(function($errno, $errstr, $errfile, $errline) {
156 156
             /* ignore user errors from phpseclib */
157 157
         }, E_USER_NOTICE);
158 158
 
Please login to merge, or discard this patch.