'any', 'requestData' => [ 'name' => [ 'validation' => DataValidator::length(2, 55), 'error' => ERRORS::INVALID_NAME ], 'email' => [ 'validation' => DataValidator::contains('@'), 'error' => ERRORS::INVALID_EMAIL ], 'password' => [ 'validation' => DataValidator::length(5, 20), 'error' => ERRORS::INVALID_PASSWORD ] ] ]; } public function handler() { $email = Controller::request('email'); $password = Controller::request('password'); $userId = $this->createNewUserAndRetrieveId($email, $password); Response::respondSuccess(array( 'userId' => $userId, 'userEmail' => $email )); } public function createNewUserAndRetrieveId($email, $password) { $userInstance = new User(); $userInstance->setProperties(array( 'email' => $email, 'password' => Hashing::hashPassword($password) )); return $userInstance->store(); } }