IcecastListeners   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A forMounts() 0 8 1
A getMounts() 0 4 1
A forMount() 0 6 1
1
<?php
2
3
namespace WITR\Services;
4
5
use Illuminate\Support\Collection;
6
7
class IcecastListeners extends Collection
8
{
9
10
    protected $mounts;
11
12
    public static function forMounts($mounts)
13
    {
14
        $listeners = new IcecastListeners();
15
16
        $listeners->mounts = $mounts;
17
18
        return $listeners;
19
    }
20
21
    public function getMounts()
22
    {
23
        return $this->mounts;
24
    }
25
26
    public function forMount($mount)
27
    {
28
        return $this->filter(function($listener) use($mount) {
29
            return $listener->mount == $mount;
30
        });
31
    }
32
33
}
34