Moves to App API

main
Yasen Pramatarov 2026-01-20 23:40:44 +02:00
parent a030562071
commit 3b50d81fb4
1 changed files with 4 additions and 6 deletions

View File

@ -9,7 +9,7 @@ use App\App;
*/
class Register {
/**
* @var PDO|null $db The database connection instance.
* @var PDO $db The database connection instance.
*/
private $db;
private $rateLimiter;
@ -18,16 +18,14 @@ class Register {
/**
* Register constructor.
* Initializes the database connection using App API.
*
* @param PDO|null $database The database connection (optional, will use App::db() if not provided).
*/
public function __construct($database = null) {
$this->db = $database instanceof PDO ? $database : App::db();
public function __construct() {
$this->db = App::db();
require_once APP_PATH . 'classes/ratelimiter.php';
require_once APP_PATH . 'classes/twoFactorAuth.php';
$this->rateLimiter = new RateLimiter($this->db);
$this->rateLimiter = new RateLimiter();
$this->twoFactorAuth = new TwoFactorAuthentication($this->db);
}