/**
* @return User|bool
*/
public function register()
{
// ...
if (empty($userData)) {
$errorCode = $this::USER_DATA_EMPTY_ERROR;
} else if ($this->authenticate() === true) {
$errorCode = $this::USER_REGISTERED_ERROR;
} else {
return $registeredUser;
}
}