Transforms   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 28
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 5 1
A findByInputFieldName() 0 10 3
1
<?php
2
3
namespace PhMap;
4
5
use \ArrayIterator;
6
7
/**
8
 * Class Transforms
9
 * @package PhMap
10
 */
11
class Transforms extends ArrayIterator {
12
13
    /**
14
     * @param Transform $transform
15
     * @return $this
16
     */
17 3
    public function add(Transform $transform) {
18 3
        $this->append($transform);
19
20 3
        return $this;
21
    }
22
23
    /**
24
     * @param string $field
25
     * @return Transform|null
26
     */
27 3
    public function findByInputFieldName($field) {
28
        /** @var Transform $transform */
29 3
        foreach ($this as $transform) {
30 3
            if ($transform->getInputFieldName() === $field) {
31 3
                return $transform;
32
            }
33 3
        }
34
35 3
        return null;
36
    }
37
38
}