Completed
Push — fix/production-builds ( 301e61...f5e011 )
by
unknown
288:28 queued 279:29
created

Queue_Buffer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get_items() 0 3 1
A get_item_values() 0 3 1
A get_item_ids() 0 3 1
1
<?php
2
3
namespace Automattic\Jetpack\Sync;
4
5
/**
6
 * A buffer of items from the queue that can be checked out
7
 */
8
class Queue_Buffer {
9
	public $id;
10
	public $items_with_ids;
11
12
	public function __construct( $id, $items_with_ids ) {
13
		$this->id             = $id;
14
		$this->items_with_ids = $items_with_ids;
15
	}
16
17
	public function get_items() {
18
		return array_combine( $this->get_item_ids(), $this->get_item_values() );
19
	}
20
21
	public function get_item_values() {
22
		return Utils::get_item_values( $this->items_with_ids );
23
	}
24
25
	public function get_item_ids() {
26
		return Utils::get_item_ids( $this->items_with_ids );
27
	}
28
}
29