Pdfunite   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A unite() 0 7 1
1
<?php
2
3
namespace Ottosmops\Pdfunite;
4
5
use Symfony\Component\Process\Process;
6
7
/*
8
 * Usage
9
 * Pdfunite::unite(['path_to_file1', 'path_to_file2'], $path_to_united_pdf);
10
 */
11
12
class Pdfunite
13
{
14 1
    public static function unite(array $srcfiles, string $resultfile)
15
    {
16 1
        $command = 'pdfunite ' . join(' ', $srcfiles) . ' '. $resultfile;
17 1
        $process = Process::fromShellCommandline($command);
18 1
        $process->run();
19
20 1
        return $process->getExitCode();
21
    }
22
23
}
24