Passed
Pull Request — master (#6)
by Nicolas
01:13
created

Some   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A some() 0 9 3
1
<?php
2
3
namespace Cocur\Chain\Link;
4
5
/**
6
 * Some.
7
 *
8
 * @author    Nicolas Reynis
9
 */
10
trait Some
11
{
12
    /**
13
     * @param callable $callback
14
     *
15
     * @return bool
16
     */
17 5
    public function some(callable $callback): bool
18
    {
19 5
        foreach ($this->array as $index => $element) {
20 4
            if ($callback($element, $index)) {
21 3
                return true;
22
            }
23
        }
24
25 2
        return false;
26
    }
27
}
28