public function __construct()
 {
     $parent = parent::__construct();
     if (strlen($this->categoryText) <= 2) {
         throw new \Exception('Category text  must be atleast 3 characters long');
     }
     return $parent;
 }
Example #2
0
 public function __construct()
 {
     $parent = parent::__construct();
     if (strlen($this->username) <= 5) {
         throw new \Exception('Invalid username');
     }
     if (strlen($this->password) <= 5) {
         throw new \Exception('Invalid password');
     }
     return $parent;
 }
 public function __construct()
 {
     $parent = parent::__construct();
     if (strlen($this->username) <= 5) {
         throw new \Exception('Username must be atleast 5 characters long');
     }
     if (strlen($this->password) <= 5) {
         throw new \Exception('Password must be atleast 5 characters long');
     }
     if ($this->confirm !== $this->password) {
         throw new \Exception('Passwords do not match');
     }
     if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
         throw new \Exception('Invalid email format');
     }
     return $parent;
 }