Completed
Push — master ( 4dc0e8...439184 )
by Hannes
22s queued 18s
created

DefaultDriver   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A merge() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace iio\libmergepdf\Driver;
6
7
use iio\libmergepdf\Source\SourceInterface;
8
9
final class DefaultDriver implements DriverInterface
10
{
11
    /**
12
     * @var DriverInterface
13
     */
14
    private $wrapped;
15
16
    public function __construct(DriverInterface $wrapped = null)
17
    {
18
        $this->wrapped = $wrapped ?: new Fpdi2Driver;
19
    }
20
21
    public function merge(SourceInterface ...$sources): string
22
    {
23
        return $this->wrapped->merge(...$sources);
24
    }
25
}
26