Singleton pattern trait.
This commit is contained in:
@@ -25,25 +25,7 @@ namespace OCA\user_sql\HashAlgorithm;
|
||||
*/
|
||||
class SHA1 implements HashAlgorithm
|
||||
{
|
||||
/**
|
||||
* @var SHA1
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SHA1
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (self::$instance === null) {
|
||||
self::$instance = new SHA1();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
use Singleton;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
@@ -68,8 +50,4 @@ class SHA1 implements HashAlgorithm
|
||||
{
|
||||
return sha1($password) === $dbHash;
|
||||
}
|
||||
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user