632bac8661
This version ditches backwards compatibility with PHP earlier than 5.6.
28 lines
633 B
PHP
28 lines
633 B
PHP
<?php
|
|
namespace Szurubooru\FormData;
|
|
use Szurubooru\IValidatable;
|
|
use Szurubooru\Validator;
|
|
|
|
class RegistrationFormData implements IValidatable
|
|
{
|
|
public $userName;
|
|
public $password;
|
|
public $email;
|
|
|
|
public function __construct($inputReader = null)
|
|
{
|
|
if ($inputReader !== null)
|
|
{
|
|
$this->userName = trim($inputReader->userName);
|
|
$this->password = $inputReader->password;
|
|
$this->email = trim($inputReader->email);
|
|
}
|
|
}
|
|
|
|
public function validate(Validator $validator)
|
|
{
|
|
$validator->validateUserName($this->userName);
|
|
$validator->validatePassword($this->password);
|
|
$validator->validateEmail($this->email);
|
|
}
|
|
}
|