Code Duplication    Length = 3-3 lines in 2 locations

includes/htmlform/OOUIHTMLForm.php 1 location

@@ 194-196 (lines=3) @@
191
	 * @return string
192
	 */
193
	public function getErrorsOrWarnings( $elements, $elementsType ) {
194
		if ( !in_array( $elementsType, [ 'error', 'warning' ] ) ) {
195
			throw new DomainException( $elementsType . ' is not a valid type.' );
196
		}
197
		if ( !$elements ) {
198
			$errors = [];
199
		} elseif ( $elements instanceof Status ) {

includes/htmlform/HTMLForm.php 1 location

@@ 1256-1258 (lines=3) @@
1253
	 * @return string
1254
	 */
1255
	public function getErrorsOrWarnings( $elements, $elementsType ) {
1256
		if ( !in_array( $elementsType, [ 'error', 'warning' ], true ) ) {
1257
			throw new DomainException( $elementsType . ' is not a valid type.' );
1258
		}
1259
		$elementstr = false;
1260
		if ( $elements instanceof Status ) {
1261
			list( $errorStatus, $warningStatus ) = $elements->splitByErrorType();