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

@@ 1119-1123 (lines=5) @@
1116
     * @since 2.0
1117
     */
1118
    public function data ( $name, $value = null, $options = null, $pod = null, $id = null, $in_form = true ) {
1119
        if ( isset( $options[ 'options' ] ) ) {
1120
            $options = array_merge( $options, $options[ 'options' ] );
1121
1122
            unset( $options[ 'options' ] );
1123
        }
1124
1125
        $data = pods_var_raw( 'data', $options, null, null, true );
1126
@@ 1163-1167 (lines=5) @@
1160
     */
1161
    public function simple_value ( $name, $value = null, $options = null, $pod = null, $id = null, $raw = false ) {
1162
        if ( in_array( pods_var( self::$type . '_object', $options ), self::simple_objects() ) ) {
1163
            if ( isset( $options[ 'options' ] ) ) {
1164
                $options = array_merge( $options, $options[ 'options' ] );
1165
1166
                unset( $options[ 'options' ] );
1167
            }
1168
1169
            if ( !is_array( $value ) && 0 < strlen( $value ) ) {
1170
                $simple = @json_decode( $value, true );
@@ 1256-1260 (lines=5) @@
1253
     * @since 2.2
1254
     */
1255
    public function value_to_label ( $name, $value = null, $options = null, $pod = null, $id = null ) {
1256
        if ( isset( $options[ 'options' ] ) ) {
1257
            $options = array_merge( $options, $options[ 'options' ] );
1258
1259
            unset( $options[ 'options' ] );
1260
        }
1261
1262
        $data = pods_var_raw( 'data', $options, null, null, true );
1263
@@ 1385-1389 (lines=5) @@
1382
        $page = min( 1, (int) $object_params[ 'page' ] );
1383
        $limit = (int) $object_params[ 'limit' ];
1384
1385
        if ( isset( $options[ 'options' ] ) ) {
1386
            $options = array_merge( $options, $options[ 'options' ] );
1387
1388
            unset( $options[ 'options' ] );
1389
        }
1390
1391
        $data = apply_filters( 'pods_field_pick_object_data', null, $name, $value, $options, $pod, $id, $object_params );
1392
        $items = array();