Code Duplication    Length = 6-6 lines in 3 locations

includes/htmlform/HTMLFormField.php 1 location

@@ 307-312 (lines=6) @@
304
			return true;
305
		}
306
307
		if ( isset( $this->mParams['required'] )
308
			&& $this->mParams['required'] !== false
309
			&& $value === ''
310
		) {
311
			return $this->msg( 'htmlform-required' )->parse();
312
		}
313
314
		if ( isset( $this->mValidationCallback ) ) {
315
			return call_user_func( $this->mValidationCallback, $value, $alldata, $this->mParent );

includes/htmlform/fields/HTMLRestrictionsField.php 1 location

@@ 72-77 (lines=6) @@
69
			return true;
70
		}
71
72
		if (
73
			isset( $this->mParams['required'] ) && $this->mParams['required'] !== false
74
			&& $value instanceof MWRestrictions && !$value->toArray()['IPAddresses']
75
		) {
76
			return $this->msg( 'htmlform-required' )->parse();
77
		}
78
79
		if ( is_string( $value ) ) {
80
			// MWRestrictions::newFromArray failed; one of the IP ranges must be invalid

includes/htmlform/fields/HTMLSelectAndOtherField.php 1 location

@@ 124-129 (lines=6) @@
121
			return $p;
122
		}
123
124
		if ( isset( $this->mParams['required'] )
125
			&& $this->mParams['required'] !== false
126
			&& $value[1] === ''
127
		) {
128
			return $this->msg( 'htmlform-required' )->parse();
129
		}
130
131
		return true;
132
	}