Code Duplication    Length = 2-6 lines in 4 locations

components/Roles/Roles.php 1 location

@@ 295-296 (lines=2) @@
292
        $params->custom_capabilities = (array) pods_var_raw( 'custom_capabilities', $params, array() );
293
        $params->custom_capabilities = array_filter( array_unique( $params->custom_capabilities ) );
294
295
        if ( !isset( $params->id ) || empty( $params->id ) || !isset( $wp_roles->role_objects[ $params->id ] ) )
296
            return pods_error( __( 'Role not found, cannot edit it.', 'pods' ) );
297
298
        /**
299
         * @var $role WP_Role

classes/PodsAPI.php 3 locations

@@ 2295-2296 (lines=2) @@
2292
            $id_required = true;
2293
        }
2294
2295
        if ( ( !isset( $params->pod ) || empty( $params->pod ) ) && ( !isset( $params->pod_id ) || empty( $params->pod_id ) ) )
2296
            return pods_error( __( 'Pod ID or name is required', 'pods' ), $this );
2297
2298
        if ( isset( $params->pod ) && is_array( $params->pod ) ) {
2299
            $pod = $params->pod;
@@ 5603-5608 (lines=6) @@
5600
        else {
5601
            $params = (object) pods_sanitize( $params );
5602
5603
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) ) {
5604
                if ( $strict ) {
5605
	                  return pods_error( 'Either Pod ID or Name are required', $this );
5606
                }
5607
5608
                return false;
5609
            }
5610
5611
		    if ( ! empty( $params->bypass_cache ) ) {
@@ 6551-6552 (lines=2) @@
6548
            if ( !isset( $params->type ) || empty( $params->type ) )
6549
                return pods_error( __( 'Object type is required', 'pods' ), $this );
6550
6551
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) )
6552
                return pods_error( __( 'Either Object ID or Name are required', 'pods' ), $this );
6553
6554
            /**
6555
             * @var $wpdb wpdb