MultiDealFacade::process()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 0
cts 15
cp 0
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 11
nc 3
nop 1
crap 12
1
<?php
2
/**
3
 * @author Jean Silva <[email protected]>
4
 * @license MIT
5
 */
6
namespace Jeancsil\FlightSpy\Facade;
7
8
use Jeancsil\FlightSpy\Command\Entity\Parameter;
9
use Symfony\Component\Console\Input\InputInterface;
10
11
class MultiDealFacade extends AbstractDealProcessor
12
{
13
    /**
14
     * @param InputInterface $input
15
     */
16
    public function process(InputInterface $input)
17
    {
18
        if (!$configFile = $input->getOption(Parameter::FILE)) {
19
            return;
20
        }
21
22
        $sessionParameters = $this
23
            ->sessionParametersFactory
24
            ->createFromConfigFile($configFile);
25
26
        if (!$response = $this->livePricesApi->getMultiDeals($sessionParameters)) {
27
            return;
28
        }
29
30
        $this->livePricePostProcessor
31
            ->setSessionParameters($sessionParameters[0])
32
            ->multiProcess($response);
33
    }
34
}
35