Change all the "new class" by "new Class"

This commit is contained in:
2021-05-07 13:10:37 +02:00
parent c8d275be31
commit c09fa961cd
39 changed files with 430 additions and 432 deletions

View File

@@ -95,15 +95,15 @@ class Users
public function checkEmail ($email)
{
if (! is_string ($email))
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid email provided : not a string"),
500);
if (strlen ($email) < 5)
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid email provided : too short"),
500);
if (strpos ($email, ":") !== false)
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid email provided : colon forbidden"),
500);
return true;
@@ -115,15 +115,15 @@ class Users
public function checkFirstname ($firstname)
{
if (! is_string ($firstname))
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid firstname provided : not a string"),
500);
if (strlen ($firstname) < 1)
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid firstname provided : too short"),
500);
if (strpos ($firstname, ":") !== false)
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid firstname provided : colon forbidden"),
500);
return true;
@@ -135,11 +135,11 @@ class Users
public function checkLastname ($lastname)
{
if (! is_string ($lastname))
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid lastname provided : not a string"),
500);
if (strpos ($lastname, ":") !== false)
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid lastname provided : colon forbidden"),
500);
return true;
@@ -151,15 +151,15 @@ class Users
public function checkPassword ($password)
{
if (! is_string ($password))
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid password provided : not a string"),
500);
if (strlen ($password) < 5)
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid password provided : too short"),
500);
if (strlen ($password) >= 128)
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"Invalid password provided : too long"),
500);
return true;
@@ -171,7 +171,7 @@ class Users
public function cryptPasswd ($password)
{
if (! function_exists ("openssl_random_pseudo_bytes"))
throw new Exception (dgettext ("domframework",
throw new \Exception (dgettext ("domframework",
"No PHP support for openssl_random_pseudo_bytes"),
500);
$cost = 11;