mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 20:27:07 +09:00
Apply PHP Code Styling & Quality Changes (#2195)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
This commit is contained in:
1 parent
628726e61a
commit
f9e9265043
2 files changed
+12
-10
No files matched your search
+1
-1
@@ -776,7 +776,7 @@ $di['geoip'] = fn () => new GeoIp2\Database\Reader(PATH_LIBRARY . '/GeoLite2-Cou
|
||||
*
|
||||
* @return \Box_Password
|
||||
*/
|
||||
$di['password'] = fn () => new \FOSSBilling\PasswordManager();
|
||||
$di['password'] = fn () => new FOSSBilling\PasswordManager();
|
||||
|
||||
/*
|
||||
* Creates a new Box_Translate object and sets the specified text domain, locale, and other options.
|
||||
|
||||
@@ -24,18 +24,19 @@ class PasswordManager
|
||||
|
||||
/**
|
||||
* Sets the password hashing algorithm.
|
||||
*
|
||||
* @return object an instance of the current class, for use with chaining.
|
||||
*
|
||||
* @throws \Exception if the provided algorithm is not listed as a valid option in PHP.
|
||||
*
|
||||
* @return object an instance of the current class, for use with chaining
|
||||
*
|
||||
* @throws \Exception if the provided algorithm is not listed as a valid option in PHP
|
||||
*/
|
||||
public function setAlgo(string $algo): object
|
||||
{
|
||||
if (!in_array($algo, password_algos())) {
|
||||
throw new \Exception("Invalid password hash provided");
|
||||
throw new \Exception('Invalid password hash provided');
|
||||
}
|
||||
|
||||
$this->algo = $algo;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -44,12 +45,13 @@ class PasswordManager
|
||||
return $this->algo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object an instance of the current class, for use with chaining
|
||||
/**
|
||||
* @return object an instance of the current class, for use with chaining
|
||||
*/
|
||||
public function setOptions($options = []): object
|
||||
{
|
||||
$this->options = array_merge(['cost' => 12], $options);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -59,8 +61,8 @@ class PasswordManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a hash of the provided password
|
||||
*
|
||||
* Creates a hash of the provided password.
|
||||
*
|
||||
* @throws \Exception if there was an error when hashing the password
|
||||
*/
|
||||
public function hashIt(string $password): string
|
||||
|
||||
Reference in new issue
Block a user