Code Duplication    Length = 10-10 lines in 2 locations

includes/misc-functions.php 2 locations

@@ 777-786 (lines=10) @@
774
			return null;
775
		}
776
777
		if ( ! is_int( $params[1] )
778
		     && ! is_float( $params[1] )
779
		     && ! is_string( $params[1] )
780
		     && $params[1] !== null
781
		     && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) )
782
		) {
783
			trigger_error( esc_html__( 'array_column(): The column key should be either a string or an integer.', 'give' ), E_USER_WARNING );
784
785
			return false;
786
		}
787
788
		if ( isset( $params[2] )
789
		     && ! is_int( $params[2] )
@@ 788-797 (lines=10) @@
785
			return false;
786
		}
787
788
		if ( isset( $params[2] )
789
		     && ! is_int( $params[2] )
790
		     && ! is_float( $params[2] )
791
		     && ! is_string( $params[2] )
792
		     && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) )
793
		) {
794
			trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING );
795
796
			return false;
797
		}
798
799
		$paramsInput     = $params[0];
800
		$paramsColumnKey = ( $params[1] !== null ) ? (string) $params[1] : null;