Completed
Push — master ( 06dc35...966f49 )
by Danny
05:47
created

ProcessFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 11 1
A createFromProcess() 0 11 1
1
<?php
2
3
namespace MyOnlineStore\Bundle\RabbitMqManagerBundle\Process;
4
5
use Symfony\Component\Process\Process as SymfonyProcess;
6
7
class ProcessFactory implements ProcessFactoryInterface
8
{
9
    /**
10
     * @inheritdoc
11
     */
12
    public function create($commandLine, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = [])
13
    {
14
        return new Process(
15
            $commandLine,
16
            $cwd,
17
            $env,
18
            $input,
19
            $timeout,
20
            $options
21
        );
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function createFromProcess(SymfonyProcess $process)
28
    {
29
        return new Process(
30
            $process->getCommandLine(),
31
            $process->getWorkingDirectory(),
32
            $process->getEnv(),
33
            $process->getInput(),
34
            $process->getTimeout(),
35
            $process->getOptions()
36
        );
37
    }
38
}
39