MergeBucket   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A reduceIfUnique() 0 4 2
1
<?php
2
namespace JClaveau\Arrays;
3
4
/**
5
 * This class represents a bucket storing values.
6
 * It's used during the merge process.
7
 */
8
class MergeBucket extends ChainableArray
9
{
10
    /**
11
     */
12
    public function reduceIfUnique()
13
    {
14
        if ($this->unique()->count() == 1)
15
            return reset( $this->data );
16
    }
17
    /**/
18
}
19