Code Duplication    Length = 10-10 lines in 2 locations

includes/misc-functions.php 2 locations

@@ 790-799 (lines=10) @@
787
			return null;
788
		}
789
790
		if ( ! is_int( $params[1] ) && ! is_float( $params[1] ) && ! is_string( $params[1] ) && $params[1] !== null && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) ) ) {
791
			trigger_error( esc_html__( 'array_column(): The column key should be either a string or an integer.', 'give' ), E_USER_WARNING );
792
793
			return false;
794
		}
795
796
		if ( isset( $params[2] ) && ! is_int( $params[2] ) && ! is_float( $params[2] ) && ! is_string( $params[2] ) && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) ) ) {
797
			trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING );
798
799
			return false;
800
		}
801
802
		$paramsInput     = $params[0];
@@ 796-805 (lines=10) @@
793
			return false;
794
		}
795
796
		if ( isset( $params[2] ) && ! is_int( $params[2] ) && ! is_float( $params[2] ) && ! is_string( $params[2] ) && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) ) ) {
797
			trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING );
798
799
			return false;
800
		}
801
802
		$paramsInput     = $params[0];
803
		$paramsColumnKey = ( $params[1] !== null ) ? (string) $params[1] : null;
804
805
		$paramsIndexKey = null;
806
		if ( isset( $params[2] ) ) {
807
			if ( is_float( $params[2] ) || is_int( $params[2] ) ) {
808
				$paramsIndexKey = (int) $params[2];