Completed
Push — development ( 477849...8fd89f )
by Nils
07:48
created
includes/libraries/PasswordLib/Password/Implementation/APR1.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     protected function hash($password, $salt, $iterations) {
114 114
         $len  = strlen($password);
115
-        $text = $password . '$apr1$' . $salt;
115
+        $text = $password.'$apr1$'.$salt;
116 116
         $bin  = md5($password.$salt.$password, true);
117 117
         for ($i = $len; $i > 0; $i -= 16) {
118 118
             $text .= substr($bin, 0, min(16, $i));
@@ -143,23 +143,23 @@  discard block
 block discarded – undo
143 143
     protected function convertToHash($bin, $salt) {
144 144
         $tmp  = '$apr1$'.$salt.'$';
145 145
         $tmp .= $this->to64(
146
-            (ord($bin[0])<<16) | (ord($bin[6])<<8) | ord($bin[12]),
146
+            (ord($bin[0]) << 16) | (ord($bin[6]) << 8) | ord($bin[12]),
147 147
             4
148 148
         );
149 149
         $tmp .= $this->to64(
150
-            (ord($bin[1])<<16) | (ord($bin[7])<<8) | ord($bin[13]),
150
+            (ord($bin[1]) << 16) | (ord($bin[7]) << 8) | ord($bin[13]),
151 151
             4
152 152
         );
153 153
         $tmp .= $this->to64(
154
-            (ord($bin[2])<<16) | (ord($bin[8])<<8) | ord($bin[14]),
154
+            (ord($bin[2]) << 16) | (ord($bin[8]) << 8) | ord($bin[14]),
155 155
             4
156 156
         );
157 157
         $tmp .= $this->to64(
158
-            (ord($bin[3])<<16) | (ord($bin[9])<<8) | ord($bin[15]),
158
+            (ord($bin[3]) << 16) | (ord($bin[9]) << 8) | ord($bin[15]),
159 159
             4
160 160
         );
161 161
         $tmp .= $this->to64(
162
-            (ord($bin[4])<<16) | (ord($bin[10])<<8) | ord($bin[5]),
162
+            (ord($bin[4]) << 16) | (ord($bin[10]) << 8) | ord($bin[5]),
163 163
             4
164 164
         );
165 165
         $tmp .= $this->to64(
Please login to merge, or discard this patch.
includes/libraries/PasswordLib/Password/Implementation/SHA256.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         if ($option == 'rounds') {
82 82
             if ($value < 1000 || $value > 999999999) {
83 83
                 throw new \InvalidArgumentException(
84
-                    'Invalid cost parameter specified, ' .
84
+                    'Invalid cost parameter specified, '.
85 85
                     'must be between 1000 and 999999999'
86 86
                 );
87 87
             }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
     protected function generateSalt() {
94 94
         $salt = parent::generateSalt();
95
-        return '$5$rounds=' . $this->options['rounds'] . '$' . $salt;
95
+        return '$5$rounds='.$this->options['rounds'].'$'.$salt;
96 96
     }
97 97
 
98 98
 }
99 99
\ No newline at end of file
Please login to merge, or discard this patch.
includes/libraries/PasswordLib/Password/Implementation/MD5.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,6 +49,6 @@
 block discarded – undo
49 49
 
50 50
     protected function generateSalt() {
51 51
         $salt = parent::generateSalt();
52
-        return '$1$' . $salt;
52
+        return '$1$'.$salt;
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
includes/libraries/PasswordLib/Password/Implementation/Joomla.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
         $chars    = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
77 77
             . '0123456789';
78 78
         $salt     = $this->generator->generateString(32, $chars);
79
-        $hash     = md5($password . $salt);
80
-        return $hash . ':' . $salt;
79
+        $hash     = md5($password.$salt);
80
+        return $hash.':'.$salt;
81 81
     }
82 82
 
83 83
     /**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             );
97 97
         }
98 98
         list ($hash, $salt) = explode(':', $hash, 2);
99
-        $test               = md5($password . $salt);
99
+        $test               = md5($password.$salt);
100 100
         return $this->compareStrings($test, $hash);
101 101
     }
102 102
 
Please login to merge, or discard this patch.
includes/libraries/PasswordLib/Password/Implementation/Blowfish.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         if (!static::detect($hash)) {
79 79
             throw new \InvalidArgumentException('Hash Not Created Here');
80 80
         }
81
-        list(, , $iterations) = explode('$', $hash, 4);
81
+        list(,, $iterations) = explode('$', $hash, 4);
82 82
         return new static(array('cost' => $iterations));
83 83
     }
84 84
 
@@ -106,6 +106,6 @@  discard block
 block discarded – undo
106 106
         $salt    = parent::generateSalt();
107 107
         $prefix  = static::getPrefix();
108 108
         $prefix .= str_pad($this->options['cost'], 2, '0', STR_PAD_LEFT);
109
-        return $prefix . '$' . $salt;
109
+        return $prefix.'$'.$salt;
110 110
     }
111 111
 }
112 112
\ No newline at end of file
Please login to merge, or discard this patch.
includes/libraries/PasswordLib/Password/Implementation/PBKDF.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     public function create($password) {
111 111
         $password = $this->checkPassword($password);
112 112
         $size     = $this->options['size'] - 8; // remove size of stored bits
113
-        $saltSize = floor($size / 5);  //Use 20% of the size for the salt
113
+        $saltSize = floor($size / 5); //Use 20% of the size for the salt
114 114
         $hashSize = $size - $saltSize;
115 115
         $salt     = $this->generator->generate($saltSize);
116 116
         return $this->hash(
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
     protected function hash($password, $salt, $iterations, $size) {
160 160
         $bit = $this->options['kdf']->derive($password, $salt, $iterations, $size);
161 161
         $sig = $this->options['kdf']->getSignature();
162
-        $sig = '$pbkdf$' . $sig . '$' . $iterations . '$' . $size;
163
-        return $sig . '$' . base64_encode($salt) . '$' . base64_encode($bit);
162
+        $sig = '$pbkdf$'.$sig.'$'.$iterations.'$'.$size;
163
+        return $sig.'$'.base64_encode($salt).'$'.base64_encode($bit);
164 164
     }
165 165
 
166 166
 }
Please login to merge, or discard this patch.
includes/libraries/PasswordLib/Password/Factory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     public function registerImplementation($name, $class) {
99 99
         $this->registerType(
100 100
             'implementations',
101
-            __NAMESPACE__ . '\\Password',
101
+            __NAMESPACE__.'\\Password',
102 102
             $name,
103 103
             $class
104 104
         );
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
      */
113 113
     protected function loadImplementations() {
114 114
         $this->loadFiles(
115
-            __DIR__ . '/Implementation',
116
-            __NAMESPACE__ . '\\Implementation\\',
115
+            __DIR__.'/Implementation',
116
+            __NAMESPACE__.'\\Implementation\\',
117 117
             array($this, 'registerImplementation')
118 118
         );
119 119
     }
Please login to merge, or discard this patch.
includes/libraries/PasswordLib/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
 namespace PasswordLib;
20 20
 
21
-require_once __DIR__ . '/Core/AutoLoader.php';
21
+require_once __DIR__.'/Core/AutoLoader.php';
22 22
 
23 23
 $autoloader = new Core\AutoLoader(__NAMESPACE__, dirname(__DIR__));
24 24
 
Please login to merge, or discard this patch.
includes/libraries/PasswordLib/Random/Source/MicroTime.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         if (function_exists('posix_times')) {
53 53
             $state .= serialize(posix_times());
54 54
         }
55
-        $state      .= getmypid() . memory_get_usage();
55
+        $state      .= getmypid().memory_get_usage();
56 56
         $state      .= serialize($_ENV);
57 57
         $this->state = hash('sha512', $state, true);
58 58
     }
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function generate($size) {
68 68
         $result      = '';
69
-        $seed        = microtime() . memory_get_usage();
70
-        $this->state = hash('sha512', $this->state . $seed, true);
69
+        $seed        = microtime().memory_get_usage();
70
+        $this->state = hash('sha512', $this->state.$seed, true);
71 71
         /**
72 72
          * Make the generated randomness a bit better by forcing a GC run which
73 73
          * should complete in a indeterminate amount of time, hence improving
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
          */
77 77
         gc_collect_cycles();
78 78
         for ($i = 0; $i < $size; $i += 8) {
79
-            $seed        = $this->state . microtime() . pack('N', $i);
79
+            $seed        = $this->state.microtime().pack('N', $i);
80 80
             $this->state = hash('sha512', $seed, true);
81 81
             /**
82 82
              * We only use the first 8 bytes here to prevent exposing the state
Please login to merge, or discard this patch.