Passed
Push — master ( fb2510...e090ea )
by kacper
03:41
created

GtidFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A makeCollectionFromString() 0 9 2
1
<?php
2
3
namespace MySQLReplication\Gtid;
4
5
/**
6
 * Class GtidService
7
 * @package MySQLReplication\Gtid
8
 */
9
class GtidFactory
10
{
11
    /**
12
     * @param string $gtids
13
     * @return GtidCollection
14
     * @throws GtidException
15
     */
16 1
    public static function makeCollectionFromString($gtids)
17
    {
18 1
        $collection = new GtidCollection();
19 1
        foreach (array_filter(explode(',', $gtids)) as $gtid) {
20 1
            $collection->add(new Gtid($gtid));
21 1
        }
22
23 1
        return $collection;
24
    }
25
}