Code Duplication    Length = 5-5 lines in 2 locations

classes/class-object-sync-sf-rest.php 2 locations

@@ 154-158 (lines=5) @@
151
					return new WP_Error( 'rest_forbidden', esc_html__( 'You do not have permissions to view this data.', 'object-sync-for-salesforce' ), array( 'status' => 401 ) );
152
				}
153
				break;
154
			case 'pull':
155
				if ( ! in_array( $http_method, array( 'GET', 'POST', 'PUT' ) ) ) {
156
					return new WP_Error( 'rest_forbidden', esc_html__( 'This kind of request is not allowed.', 'object-sync-for-salesforce' ), array( 'status' => 401 ) );
157
				}
158
				break;
159
			case 'push':
160
				if ( ! in_array( $http_method, array( 'POST', 'PUT' ) ) ) {
161
					return new WP_Error( 'rest_forbidden', esc_html__( 'This kind of request is not allowed.', 'object-sync-for-salesforce' ), array( 'status' => 401 ) );
@@ 159-163 (lines=5) @@
156
					return new WP_Error( 'rest_forbidden', esc_html__( 'This kind of request is not allowed.', 'object-sync-for-salesforce' ), array( 'status' => 401 ) );
157
				}
158
				break;
159
			case 'push':
160
				if ( ! in_array( $http_method, array( 'POST', 'PUT' ) ) ) {
161
					return new WP_Error( 'rest_forbidden', esc_html__( 'This kind of request is not allowed.', 'object-sync-for-salesforce' ), array( 'status' => 401 ) );
162
				}
163
				break;
164
			default:
165
				if ( ! current_user_can( 'configure_salesforce' ) ) {
166
					return new WP_Error( 'rest_forbidden', esc_html__( 'You do not have permissions to view this data.', 'object-sync-for-salesforce' ), array( 'status' => 401 ) );