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

Pdfunite::unite()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 2
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