src/Auth.php
public function register($email, $password, $username = null, callable $callback = null) {
		$this->throttle([ 'enumerateUsers', $this->getIpAddress() ], 1, (60 * 60), 75);
		$this->throttle([ 'createNewAccount', $this->getIpAddress() ], 1, (60 * 60 * 12), 5, true);

		$newUserId = $this->createUserInternal(false, $email, $password, $username, $callback);

		$this->throttle([ 'createNewAccount', $this->getIpAddress() ], 1, (60 * 60 * 12), 5, false);

		return $newUserId;
	}
public function register($email, $password, $username = null, callable $callback = null) {
		$this->throttle([ 'enumerateUsers', $this->getIpAddress() ], 1, (60 * 60), 75);
		$this->throttle([ 'createNewAccount', $this->getIpAddress() ], 1, (60 * 60 * 12), 5, true);

		$newUserId = $this->createUserInternal(false, $email, $password, $username, $callback);

		$this->throttle([ 'createNewAccount', $this->getIpAddress() ], 1, (60 * 60 * 12), 5, false);

		return $newUserId;
	}
public function register ( $ email , $ password , $ username = null , callable $ callback = null ) { $ this -> throttle ( [ 'enumerateUsers' , $ this -> getIpAddress ( ) ] , 1 , ( 60 * 60 ) , 75 ) ; $ this -> throttle ( [ 'createNewAccount' , $ this -> getIpAddress ( ) ] , 1 , ( 60 * 60 * 12 ) , 5 , true ) ; $ newUserId = $ this -> createUserInternal ( false , $ email , $ password , $ username , $ callback ) ; $ this -> throttle ( [ 'createNewAccount' , $ this -> getIpAddress ( ) ] , 1 , ( 60 * 60 * 12 ) , 5 , false ) ; return $ newUserId ; }
Attempts to sign up a user

If you want the user's account to be activated by default, pass `null` as the callback

If you want to make the user verify their email address first, pass an anonymous function as the callback

The callback function must have the following signature:

`function ($selector, $token)`

Both pieces of information must be sent to the user, usually embedded in a link

When the user wants to verify their email address as a next step, both pieces will be required again

@param string $email the email address to register
@param string $password the password for the new account
@param string|null $username (optional) the username that will be displayed
@param callable|null $callback (optional) the function that sends the confirmation email to the user
@return int the ID of the user that has been created (if any)
@throws InvalidEmailException if the email address was invalid
@throws InvalidPasswordException if the password was invalid
@throws UserAlreadyExistsException if a user with the specified email address already exists
@throws TooManyRequestsException if the number of allowed attempts/requests has been exceeded
@throws AuthError if an internal problem occurred (do *not* catch)

@see confirmEmail
@see confirmEmailAndSignIn
Attempts to sign up a user