Passed
Push — master ( 2a728a...34eaf6 )
by Charles
03:31
created
src/Keypair.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
      * @return string|null
37 37
      */
38
-    public function getPublicKey() :? string
38
+    public function getPublicKey() : ? string
39 39
     {
40 40
         return $this->publicKey;
41 41
     }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @return string|null
47 47
      */
48
-    public function getSecretKey() :? string
48
+    public function getSecretKey() : ? string
49 49
     {
50 50
         return $this->secretKey;
51 51
     }
Please login to merge, or discard this patch.
src/Authorization.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
      * @param string $date
233 233
      * @return int|boolean
234 234
      */
235
-    private function getTimeDrift(string $date) :? int
235
+    private function getTimeDrift(string $date) : ? int
236 236
     {
237 237
         $now = new \DateTime();
238 238
         $now->format(\DateTime::RFC1123);
Please login to merge, or discard this patch.
tests/mock/Authentication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 
8 8
 final class Authentication extends AbstractAuthentication
9 9
 {
10
-    protected function getTokenFromAccessToken(string $accessToken) :? Token
10
+    protected function getTokenFromAccessToken(string $accessToken) : ? Token
11 11
     {
12 12
         // Return a fixed token
13 13
         return new Token(
Please login to merge, or discard this patch.
src/middleware/AbstractAuthentication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
      * @param string $accessToken
114 114
      * @return \ncryptf\Token
115 115
      */
116
-    abstract protected function getTokenFromAccessToken(string $accessToken) :? Token;
116
+    abstract protected function getTokenFromAccessToken(string $accessToken) : ? Token;
117 117
 
118 118
     /**
119 119
      * Given a particular token, returns an object, array, or integer representing the user
Please login to merge, or discard this patch.
src/middleware/RequestParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
      * @param int $version
82 82
      * @return string|null
83 83
      */
84
-    private function decryptRequest(EncryptionKeyInterface $key, ServerRequestInterface $request, string $rawBody, int $version) :? string
84
+    private function decryptRequest(EncryptionKeyInterface $key, ServerRequestInterface $request, string $rawBody, int $version) : ? string
85 85
     {
86 86
         static $response = null;
87 87
         static $nonce = null;
Please login to merge, or discard this patch.
tests/AuthenticationTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             $response = Dispatcher::run(
38 38
                 [
39 39
                     new Authentication,
40
-                    function ($request, $next) {
40
+                    function($request, $next) {
41 41
                         $this->assertInstanceOf('\ncryptf\Token', $request->getAttribute('ncryptf-token'));
42 42
                         $this->assertEquals(true, \is_array($request->getAttribute('ncryptf-user')));
43 43
                         return $next->handle($request);
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
                     ->withHeader('Authorization', $auth->getHeader())
48 48
                     ->withHeader('Content-Type', 'application/json')
49 49
                     ->withHeader('Accept', 'application/json')
50
-                    ->withBody((function () use ($params) {
50
+                    ->withBody((function() use ($params) {
51 51
                         $stream = fopen('php://memory', 'r+');
52
-                        fwrite($stream, \is_array($params[2]) ? \json_encode($params[2]): $params[2]);
52
+                        fwrite($stream, \is_array($params[2]) ? \json_encode($params[2]) : $params[2]);
53 53
                         rewind($stream);
54 54
                         return new \Zend\Diactoros\Stream($stream);
55 55
                     })())
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                 [
74 74
                     new RequestParser($cache),
75 75
                     new Authentication,
76
-                    function ($request, $next) {
76
+                    function($request, $next) {
77 77
                         $this->assertInstanceOf('\ncryptf\Token', $request->getAttribute('ncryptf-token'));
78 78
                         $this->assertEquals(true, \is_array($request->getAttribute('ncryptf-user')));
79 79
                         return $next->handle($request);
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
                     ->withHeader('Content-Type', 'application/vnd.ncryptf+json')
85 85
                     ->withHeader('Accept', 'application/json')
86 86
                     ->withHeader('X-HashId', $serverKey->getHashIdentifier())
87
-                    ->withBody((function () use ($params, $serverKey, $myKey) {
88
-                        $data = \is_array($params[2]) ? \json_encode($params[2]): $params[2];
87
+                    ->withBody((function() use ($params, $serverKey, $myKey) {
88
+                        $data = \is_array($params[2]) ? \json_encode($params[2]) : $params[2];
89 89
 
90 90
                         $request = new Request(
91 91
                             $myKey->getBoxSecretKey(),
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                 [
123 123
                     new RequestParser($cache),
124 124
                     new Authentication,
125
-                    function ($request, $next) {
125
+                    function($request, $next) {
126 126
                         $this->assertInstanceOf('\ncryptf\Token', $request->getAttribute('ncryptf-token'));
127 127
                         $this->assertEquals(true, \is_array($request->getAttribute('ncryptf-user')));
128 128
                         return $next->handle($request);
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
                     ->withHeader('X-HashId', $serverKey->getHashIdentifier())
136 136
                     ->withHeader('X-Nonce', \base64_encode($nonce))
137 137
                     ->withHeader('X-PubKey', \base64_encode($myKey->getBoxPublicKey()))
138
-                    ->withBody((function () use ($params, $serverKey, $myKey, $nonce) {
139
-                        $data = \is_array($params[2]) ? \json_encode($params[2]): $params[2];
138
+                    ->withBody((function() use ($params, $serverKey, $myKey, $nonce) {
139
+                        $data = \is_array($params[2]) ? \json_encode($params[2]) : $params[2];
140 140
 
141 141
                         $request = new Request(
142 142
                             $myKey->getBoxSecretKey(),
Please login to merge, or discard this patch.