MergeBucket::reduceIfUnique()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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