Test Failed
Push — master ( aafbf9...dbc273 )
by Andreas
02:09
created

Pdfunite   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 9
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
    public static function unite(array $srcfiles, string $resultfile)
15
    {
16
        $command = 'pdfunite ' . join(' ', $srcfiles) . ' '. $resultfile;
17
        $process = Process::fromShellCommandline($command);
18
        $process->run();
19
20
        return $process->getExitCode();
21
    }
22
23
}
24