Code Duplication    Length = 10-10 lines in 2 locations

includes/misc-functions.php 2 locations

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