Code Duplication    Length = 7-7 lines in 2 locations

includes/CMB2_REST_Controller.php 2 locations

@@ 284-290 (lines=7) @@
281
	 *
282
	 * @return void
283
	 */
284
	protected function initiate_rest_read_box( $request, $request_type ) {
285
		$this->initiate_rest_box( $request, $request_type );
286
287
		if ( ! is_wp_error( $this->rest_box ) && ! $this->rest_box->rest_read ) {
288
			$this->rest_box = new WP_Error( 'cmb2_rest_no_read_error', __( 'This box does not have read permissions.', 'cmb2' ), array( 'status' => 403 ) );
289
		}
290
	}
291
292
	/**
293
	 * Initiates the request property and the rest_box property if box is writeable.
@@ 302-308 (lines=7) @@
299
	 *
300
	 * @return void
301
	 */
302
	protected function initiate_rest_edit_box( $request, $request_type ) {
303
		$this->initiate_rest_box( $request, $request_type );
304
305
		if ( ! is_wp_error( $this->rest_box ) && ! $this->rest_box->rest_edit ) {
306
			$this->rest_box = new WP_Error( 'cmb2_rest_no_write_error', __( 'This box does not have write permissions.', 'cmb2' ), array( 'status' => 403 ) );
307
		}
308
	}
309
310
	/**
311
	 * Initiates the request property and the rest_box property.