Passed
Push — master ( df02ac...d309df )
by Petr
02:23
created
php-tests/MethodsTests/BasicTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@
 block discarded – undo
44 44
     public function stampsProvider(): array
45 45
     {
46 46
         return [
47
-            [ time() + 10, 20, true],
48
-            [ time() - 10, 20, true],
49
-            [ time() + 50, 20, false],
50
-            [ time() - 50, 20, false],
47
+            [time() + 10, 20, true],
48
+            [time() - 10, 20, true],
49
+            [time() + 50, 20, false],
50
+            [time() - 50, 20, false],
51 51
         ];
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
php-tests/MethodsTests/CertsTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         //create signature
53 53
         $privateKey = openssl_pkey_new([
54
-            "private_key_bits" => 1024,  # not need too long for testing purposes
54
+            "private_key_bits" => 1024, # not need too long for testing purposes
55 55
             "private_key_type" => OPENSSL_KEYTYPE_RSA,
56 56
         ]);
57 57
         $privateData = openssl_pkey_get_details($privateKey);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         // now query itself
66 66
         $urlSource = new Sources\Sources();
67 67
         $urlSource->setAddress($this->signLink($privateKey, '/dummy/?user=testing&pass=asdf123ghjk456&timestamp=123456', 'qwertziop'));
68
-        $method = new Methods\UrlCerts(new \MockAuthCert($mockUser, ''), null, new Handler($urlSource) );
68
+        $method = new Methods\UrlCerts(new \MockAuthCert($mockUser, ''), null, new Handler($urlSource));
69 69
         $method->process(new \MockCredentials([Methods\UrlHash::INPUT_NAME => 'testing', Methods\UrlHash::INPUT_STAMP => time(), ]));
70 70
         $this->assertTrue($method->isAuthorized());
71 71
         $method->remove();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     {
88 88
         //create signature
89 89
         $privateKey = openssl_pkey_new([
90
-            "private_key_bits" => 1024,  # not need too long for testing purposes
90
+            "private_key_bits" => 1024, # not need too long for testing purposes
91 91
             "private_key_type" => OPENSSL_KEYTYPE_RSA,
92 92
         ]);
93 93
         $privateData = openssl_pkey_get_details($privateKey);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         // now query itself
111 111
         $method = new Methods\HttpCerts(new \MockAuthCert($mockUser, ''), null, new Handler($urlSource), new \MockCredentials(
112 112
             [Methods\HttpCerts::INPUT_NAME => 'testing', Methods\HttpCerts::INPUT_PASS => rawurlencode(base64_encode($signature)), ]
113
-        ) );
113
+        ));
114 114
         $method->process(new \MockCredentials());
115 115
         $this->assertTrue($method->isAuthorized());
116 116
     }
Please login to merge, or discard this patch.
php-src/Methods/UrlCerts.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@
 block discarded – undo
43 43
 
44 44
     public function process(\ArrayAccess $credentials): void
45 45
     {
46
-        $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '' ;
47
-        $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2)) : $name ;
48
-        $stamp = $credentials->offsetExists(static::INPUT_STAMP) ? intval(strval($credentials->offsetGet(static::INPUT_STAMP))) : 0 ;
46
+        $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '';
47
+        $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2)) : $name;
48
+        $stamp = $credentials->offsetExists(static::INPUT_STAMP) ? intval(strval($credentials->offsetGet(static::INPUT_STAMP))) : 0;
49 49
 
50 50
         $wantedUser = $this->authenticator->getCertData(strval($name));
51 51
         if ($wantedUser && !empty($stamp) && $this->checkStamp($stamp)) {
Please login to merge, or discard this patch.
php-src/Methods/HttpDigest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
         preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]*?)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER);
94 94
 
95 95
         foreach ($matches as $m) {
96
-            $data[strval($m[1])] = strval($m[3] ?: ( $m[4] ?? '' ));
96
+            $data[strval($m[1])] = strval($m[3] ?: ($m[4] ?? ''));
97 97
             unset($needed_parts[$m[1]]);
98 98
         }
99 99
 
Please login to merge, or discard this patch.
php-src/Methods/Banned.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
 
82 82
     public function process(\ArrayAccess $credentials): void
83 83
     {
84
-        $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '' ;
84
+        $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '';
85 85
         $ip = strval($this->server->offsetGet(static::SERVER_REMOTE));
86 86
         if ($this->libBan->has(
87 87
             strval(preg_replace(static::PREG_IP4, '', $ip)),
Please login to merge, or discard this patch.
php-src/Methods/UrlHash.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@
 block discarded – undo
53 53
 
54 54
     public function process(\ArrayAccess $credentials): void
55 55
     {
56
-        $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '' ;
57
-        $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2) ): $name ;
58
-        $stamp = $credentials->offsetExists(static::INPUT_STAMP) ? intval(strval($credentials->offsetGet(static::INPUT_STAMP))) : 0 ;
56
+        $name = $credentials->offsetExists(static::INPUT_NAME) ? strval($credentials->offsetGet(static::INPUT_NAME)) : '';
57
+        $name = $credentials->offsetExists(static::INPUT_NAME2) ? strval($credentials->offsetGet(static::INPUT_NAME2)) : $name;
58
+        $stamp = $credentials->offsetExists(static::INPUT_STAMP) ? intval(strval($credentials->offsetGet(static::INPUT_STAMP))) : 0;
59 59
 
60 60
         $wantedUser = $this->authenticator->getCertData(strval($name));
61 61
         if ($wantedUser && !empty($stamp) && $this->checkStamp($stamp)) {
Please login to merge, or discard this patch.
php-src/Methods/HttpCerts.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
 
43 43
     public function process(\ArrayAccess $credentials): void
44 44
     {
45
-        $name = $this->server->offsetExists(static::INPUT_NAME) ? strval($this->server->offsetGet(static::INPUT_NAME)) : '' ;
46
-        $digest = $this->server->offsetExists(static::INPUT_PASS) ? strval($this->server->offsetGet(static::INPUT_PASS)) : '' ;
45
+        $name = $this->server->offsetExists(static::INPUT_NAME) ? strval($this->server->offsetGet(static::INPUT_NAME)) : '';
46
+        $digest = $this->server->offsetExists(static::INPUT_PASS) ? strval($this->server->offsetGet(static::INPUT_PASS)) : '';
47 47
         $wantedUser = $this->authenticator->getCertData(strval($name));
48 48
         if ($wantedUser && $digest) {
49 49
             // now we have public key and salt from our storage, so it's time to check it
Please login to merge, or discard this patch.
php-src/Sources/TGroups.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,8 +132,8 @@
 block discarded – undo
132 132
         foreach ($groupLines as &$line) {
133 133
             if ($line[IAccessGroups::GRP_ID] == $group->getGroupId()) {
134 134
                 // REFILL
135
-                $line[IAccessGroups::GRP_NAME] = !empty($groupName) ? $groupName : $line[IAccessGroups::GRP_NAME] ;
136
-                $line[IAccessGroups::GRP_DESC] = !empty($groupDesc) ? $groupDesc : $line[IAccessGroups::GRP_DESC] ;
135
+                $line[IAccessGroups::GRP_NAME] = !empty($groupName) ? $groupName : $line[IAccessGroups::GRP_NAME];
136
+                $line[IAccessGroups::GRP_DESC] = !empty($groupDesc) ? $groupDesc : $line[IAccessGroups::GRP_DESC];
137 137
             }
138 138
         }
139 139
 
Please login to merge, or discard this patch.
php-src/Sources/TExpiration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     public function setExpirationNotice($class, int $nextChange): void
34 34
     {
35 35
         if ($class && is_object($class) && $class instanceof IExpire) {
36
-            $class->setExpireNotice( $this->shallExpire($nextChange));
36
+            $class->setExpireNotice($this->shallExpire($nextChange));
37 37
         }
38 38
     }
39 39
 
Please login to merge, or discard this patch.