szurubooru/src/FormData/RegistrationFormData.php
Marcin Kurczewski 632bac8661 Added "use ..." statements
This version ditches backwards compatibility with PHP earlier than 5.6.
2014-10-18 18:48:36 +02:00

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);
}
}