diff --git a/src/Illuminate/Hashing/ArgonHasher.php b/src/Illuminate/Hashing/ArgonHasher.php index caf81e343592..c6536be73661 100644 --- a/src/Illuminate/Hashing/ArgonHasher.php +++ b/src/Illuminate/Hashing/ArgonHasher.php @@ -12,7 +12,7 @@ class ArgonHasher implements HasherContract * * @var int */ - protected $processors = 2; + protected $threads = 2; /** * The default memory cost factor. @@ -51,7 +51,7 @@ public function make($value, array $options = []) $hash = password_hash($value, PASSWORD_ARGON2I, [ 'memory_cost' => $this->memory($options), 'time_cost' => $this->time($options), - 'threads' => $this->processors($options), + 'threads' => $this->threads($options), ]); if ($hash === false) { @@ -90,7 +90,7 @@ public function needsRehash($hashedValue, array $options = []) return password_needs_rehash($hashedValue, PASSWORD_ARGON2I, [ 'memory_cost' => $this->memory($options), 'time_cost' => $this->time($options), - 'threads' => $this->processors($options), + 'threads' => $this->threads($options), ]); } @@ -101,7 +101,7 @@ public function needsRehash($hashedValue, array $options = []) * * @return $this; */ - public function setProcessors(int $threads) + public function setThreads(int $threads) { $this->threads = $threads; @@ -139,10 +139,10 @@ public function setTime(int $time) /** * Extract the memory cost value from the options array. * - * @param $options + * @param array $options * @return int */ - protected function memory($options) + protected function memory(array $options) { return $options['memory'] ?? $this->memory; } @@ -150,10 +150,10 @@ protected function memory($options) /** * Extract the time cost value from the options array. * - * @param $options + * @param array $options * @return int */ - protected function time($options) + protected function time(array $options) { return $options['time'] ?? $this->time; } @@ -161,11 +161,11 @@ protected function time($options) /** * Extract the threads value from the options array. * - * @param $options + * @param array $options * @return int */ - protected function processors($options) + protected function threads(array $options) { - return $options['processors'] ?? $this->processors; + return $options['threads'] ?? $this->threads; } } diff --git a/tests/Hashing/HasherTest.php b/tests/Hashing/HasherTest.php index cace3c9c7673..1d008a3e0c14 100755 --- a/tests/Hashing/HasherTest.php +++ b/tests/Hashing/HasherTest.php @@ -27,6 +27,6 @@ public function testBasicArgonHashing() $this->assertNotSame('password', $value); $this->assertTrue($hasher->check('password', $value)); $this->assertFalse($hasher->needsRehash($value)); - $this->assertTrue($hasher->needsRehash($value, ['processors' => 1])); + $this->assertTrue($hasher->needsRehash($value, ['threads' => 1])); } }