Code Duplication    Length = 5-5 lines in 6 locations

components/Migrate-Packages/Migrate-Packages.php 2 locations

@@ 617-621 (lines=5) @@
614
            }
615
616
            foreach ( $export[ 'pods' ] as &$pod ) {
617
                if ( isset( $pod[ 'options' ] ) ) {
618
                    $pod = array_merge( $pod, $pod[ 'options' ] );
619
620
                    unset( $pod[ 'options' ] );
621
                }
622
623
                foreach ( $pod as $option => $option_value ) {
624
                    if ( in_array( $option, $options_ignore ) || null === $option_value )
@@ 630-634 (lines=5) @@
627
628
                if ( !empty( $pod[ 'fields' ] ) ) {
629
                    foreach ( $pod[ 'fields' ] as &$field ) {
630
                        if ( isset( $field[ 'options' ] ) ) {
631
                            $field = array_merge( $field, $field[ 'options' ] );
632
633
                            unset( $field[ 'options' ] );
634
                        }
635
636
                        foreach ( $field as $option => $option_value ) {
637
                            if ( in_array( $option, $options_ignore ) || null === $option_value )

classes/fields/pick.php 4 locations

@@ 1052-1056 (lines=5) @@
1049
     * @since 2.0
1050
     */
1051
    public function data ( $name, $value = null, $options = null, $pod = null, $id = null, $in_form = true ) {
1052
        if ( isset( $options[ 'options' ] ) ) {
1053
            $options = array_merge( $options, $options[ 'options' ] );
1054
1055
            unset( $options[ 'options' ] );
1056
        }
1057
1058
        $data = pods_var_raw( 'data', $options, null, null, true );
1059
@@ 1096-1100 (lines=5) @@
1093
     */
1094
    public function simple_value ( $name, $value = null, $options = null, $pod = null, $id = null, $raw = false ) {
1095
        if ( in_array( pods_var( self::$type . '_object', $options ), self::simple_objects() ) ) {
1096
            if ( isset( $options[ 'options' ] ) ) {
1097
                $options = array_merge( $options, $options[ 'options' ] );
1098
1099
                unset( $options[ 'options' ] );
1100
            }
1101
1102
            if ( !is_array( $value ) && 0 < strlen( $value ) ) {
1103
                $simple = @json_decode( $value, true );
@@ 1189-1193 (lines=5) @@
1186
     * @since 2.2
1187
     */
1188
    public function value_to_label ( $name, $value = null, $options = null, $pod = null, $id = null ) {
1189
        if ( isset( $options[ 'options' ] ) ) {
1190
            $options = array_merge( $options, $options[ 'options' ] );
1191
1192
            unset( $options[ 'options' ] );
1193
        }
1194
1195
        $data = pods_var_raw( 'data', $options, null, null, true );
1196
@@ 1323-1327 (lines=5) @@
1320
        $page = min( 1, (int) $object_params[ 'page' ] );
1321
        $limit = (int) $object_params[ 'limit' ];
1322
1323
        if ( isset( $options[ 'options' ] ) ) {
1324
            $options = array_merge( $options, $options[ 'options' ] );
1325
1326
            unset( $options[ 'options' ] );
1327
        }
1328
1329
        $data = apply_filters( 'pods_field_pick_object_data', null, $name, $value, $options, $pod, $id, $object_params );
1330
        $items = array();