CollectionManager   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 3
Metric Value
wmc 3
c 3
b 0
f 3
lcom 0
cbo 1
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A collectionContains() 0 10 3
1
<?php
2
3
namespace Accessible\MethodManager;
4
5
class CollectionManager extends MethodCallManager
6
{
7
    /**
8
     * Indicates wether given collection contains the wanted item or not.
9
     *
10
     * @param  mixed $needle
11
     * @param  array $haystack
12
     *
13
     * @return bool
14
     */
15 3
    public static function collectionContains($needle, $haystack)
16
    {
17 3
        foreach ($haystack as $value) {
18 3
            if ($value === $needle) {
19 3
                return true;
20
            }
21 3
        }
22
23 3
        return false;
24
    }
25
}
26