LinkRegistry::getLinks()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace rtens\domin\delivery\web\renderers\link;
3
4
class LinkRegistry {
5
6
    /** @var Link[] */
7
    private $links = [];
8
9
    /**
10
     * @param mixed $object
11
     * @return array|Link[]
12
     */
13
    public function getLinks($object) {
14
        return array_filter($this->links, function (Link $link) use ($object) {
15
            return $link->handles($object);
16
        });
17
    }
18
19
    public function add(Link $link) {
20
        $this->links[] = $link;
21
    }
22
}