$ret = self::getTarget( $this->mTarget );
if ( !$ret instanceof User ) {
if ( $this->mTarget != '' ) {
+ // Messages used here: notargettext, noemailtext, nowikiemailtext
$ret = ( $ret == 'notarget' ) ? 'emailnotarget' : ( $ret . 'text' );
$out->wrapWikiMsg( "<p class='error'>$1</p>", $ret );
}
* Validate target User
*
* @param string $target target user name
- * @return User object on success or a string on error
+ * @return User User object on success or a string on error
*/
public static function getTarget( $target ) {
if ( $target == '' ) {
/**
* Check whether a user is allowed to send email
*
- * @param $user User object
- * @param string $editToken edit token
- * @return null on success or string on error
+ * @param User $user
+ * @param string $editToken Edit token
+ * @return string|null Null on success or string on error
*/
public static function getPermissionsError( $user, $editToken ) {
global $wgEnableEmail, $wgEnableUserEmail;
/**
* Form to ask for target user name.
*
- * @param string $name user name submitted.
- * @return String: form asking for user name.
+ * @param string $name User name submitted.
+ * @return string Form asking for user name.
*/
protected function userForm( $name ) {
global $wgScript;
* Submit callback for an HTMLForm object, will simply call submit().
*
* @since 1.20
- * @param $data array
- * @param $form HTMLForm object
+ * @param array $data
+ * @param HTMLForm $form
* @return Status|string|bool
*/
public static function uiSubmit( array $data, HTMLForm $form ) {
*
* @param array $data
* @param IContextSource $context
- * @return Mixed: Status object, or potentially a String on error
+ * @return Status|string|bool Status object, or potentially a String on error
* or maybe even true on success if anything uses the EmailUser hook.
*/
public static function submit( array $data, IContextSource $context ) {
$target = self::getTarget( $data['Target'] );
if ( !$target instanceof User ) {
+ // Messages used here: notargettext, noemailtext, nowikiemailtext
return $context->msg( $target . 'text' )->parseAsBlock();
}