Completed
Push — master ( c2ba48...1fd225 )
by Markus
14s queued 12s
created

ProcessFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 3 1
1
<?php
2
3
namespace Jellyfish\ProcessSymfony;
4
5
use Jellyfish\Process\ProcessFactoryInterface;
6
use Jellyfish\Process\ProcessInterface;
7
8
class ProcessFactory implements ProcessFactoryInterface
9
{
10
    protected $tempDir;
11
12
    /**
13
     * @param string $tempDir
14
     */
15
    public function __construct(string $tempDir)
16
    {
17
        $this->tempDir = $tempDir;
18
    }
19
20
    /**
21
     * @param array $command
22
     *
23
     * @return \Jellyfish\Process\ProcessInterface
24
     */
25
    public function create(array $command): ProcessInterface
26
    {
27
        return new Process($command, $this->tempDir);
28
    }
29
}
30