Code Duplication    Length = 9-9 lines in 2 locations

includes/api/class-wpinv-rest-items-controller.php 1 location

@@ 862-870 (lines=9) @@
859
		$links = $this->prepare_links( $item );
860
		$response->add_links( $links );
861
862
		if ( ! empty( $links['self']['href'] ) ) {
863
			$actions = $this->get_available_actions( $item, $request );
864
865
			$self = $links['self']['href'];
866
867
			foreach ( $actions as $rel ) {
868
				$response->add_link( $rel, $self );
869
			}
870
		}
871
872
		/**
873
		 * Filters the item data for a response.

includes/api/class-wpinv-rest-invoice-controller.php 1 location

@@ 836-844 (lines=9) @@
833
		$links = $this->prepare_links( $invoice );
834
		$response->add_links( $links );
835
836
		if ( ! empty( $links['self']['href'] ) ) {
837
			$actions = $this->get_available_actions( $invoice, $request );
838
839
			$self = $links['self']['href'];
840
841
			foreach ( $actions as $rel ) {
842
				$response->add_link( $rel, $self );
843
			}
844
		}
845
846
		/**
847
		 * Filters the invoice data for a response.