missing-indexable-bucket.php
1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
namespace Yoast\WP\SEO\Analytics\Domain;
/**
* A collection domain object.
*/
class Missing_Indexable_Bucket {
/**
* All the missing indexable count objects.
*
* @var array<Missing_Indexable_Count> $missing_indexable_counts
*/
private $missing_indexable_counts;
/**
* The constructor.
*/
public function __construct() {
$this->missing_indexable_counts = [];
}
/**
* Adds a missing indexable count object to this bucket.
*
* @param Missing_Indexable_Count $missing_indexable_count The missing indexable count object.
*
* @return void
*/
public function add_missing_indexable_count( Missing_Indexable_Count $missing_indexable_count ): void {
$this->missing_indexable_counts[] = $missing_indexable_count;
}
/**
* Returns the array representation of all indexable counts.
*
* @return array
*/
public function to_array(): array {
return \array_map(
function ( $item ) {
return $item->to_array();
},
$this->missing_indexable_counts
);
}
}