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

@@ 1063-1067 (lines=5) @@
1060
     * @since 2.0
1061
     */
1062
    public function data ( $name, $value = null, $options = null, $pod = null, $id = null, $in_form = true ) {
1063
        if ( isset( $options[ 'options' ] ) ) {
1064
            $options = array_merge( $options, $options[ 'options' ] );
1065
1066
            unset( $options[ 'options' ] );
1067
        }
1068
1069
        $data = pods_var_raw( 'data', $options, null, null, true );
1070
@@ 1107-1111 (lines=5) @@
1104
     */
1105
    public function simple_value ( $name, $value = null, $options = null, $pod = null, $id = null, $raw = false ) {
1106
        if ( in_array( pods_var( self::$type . '_object', $options ), self::simple_objects() ) ) {
1107
            if ( isset( $options[ 'options' ] ) ) {
1108
                $options = array_merge( $options, $options[ 'options' ] );
1109
1110
                unset( $options[ 'options' ] );
1111
            }
1112
1113
            if ( !is_array( $value ) && 0 < strlen( $value ) ) {
1114
                $simple = @json_decode( $value, true );
@@ 1200-1204 (lines=5) @@
1197
     * @since 2.2
1198
     */
1199
    public function value_to_label ( $name, $value = null, $options = null, $pod = null, $id = null ) {
1200
        if ( isset( $options[ 'options' ] ) ) {
1201
            $options = array_merge( $options, $options[ 'options' ] );
1202
1203
            unset( $options[ 'options' ] );
1204
        }
1205
1206
        $data = pods_var_raw( 'data', $options, null, null, true );
1207
@@ 1334-1338 (lines=5) @@
1331
        $page = min( 1, (int) $object_params[ 'page' ] );
1332
        $limit = (int) $object_params[ 'limit' ];
1333
1334
        if ( isset( $options[ 'options' ] ) ) {
1335
            $options = array_merge( $options, $options[ 'options' ] );
1336
1337
            unset( $options[ 'options' ] );
1338
        }
1339
1340
        $data = apply_filters( 'pods_field_pick_object_data', null, $name, $value, $options, $pod, $id, $object_params );
1341
        $items = array();