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

@@ 2281-2282 (lines=2) @@
2278
            $id_required = true;
2279
        }
2280
2281
        if ( ( !isset( $params->pod ) || empty( $params->pod ) ) && ( !isset( $params->pod_id ) || empty( $params->pod_id ) ) )
2282
            return pods_error( __( 'Pod ID or name is required', 'pods' ), $this );
2283
2284
        if ( isset( $params->pod ) && is_array( $params->pod ) ) {
2285
            $pod = $params->pod;
@@ 6237-6238 (lines=2) @@
6234
            if ( !isset( $params->type ) || empty( $params->type ) )
6235
                return pods_error( __( 'Object type is required', 'pods' ), $this );
6236
6237
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) )
6238
                return pods_error( __( 'Either Object ID or Name are required', 'pods' ), $this );
6239
6240
            /**
6241
             * @var $wpdb wpdb
@@ 5330-5335 (lines=6) @@
5327
        else {
5328
            $params = (object) pods_sanitize( $params );
5329
5330
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) ) {
5331
                if ( $strict )
5332
                    return pods_error( 'Either Pod ID or Name are required', $this );
5333
5334
                return false;
5335
            }
5336
5337
            if ( isset( $params->name ) ) {
5338
                $pod = false;