AbstractDataProvider::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\FactFinder\DataProvider;
9
10
use SprykerEco\Shared\FactFinder\FactFinderConstants;
11
use SprykerEco\Yves\FactFinder\Dependency\Clients\FactFinderToFactFinderClientInterface;
12
use Symfony\Component\HttpFoundation\Request;
13
14
abstract class AbstractDataProvider
15
{
16
    /**
17
     * @var \SprykerEco\Yves\FactFinder\Dependency\Clients\FactFinderToFactFinderClientInterface
18
     */
19
    protected $factFinderClient;
20
21
    /**
22
     * @param \SprykerEco\Yves\FactFinder\Dependency\Clients\FactFinderToFactFinderClientInterface $factFinderClient
23
     */
24
    public function __construct(FactFinderToFactFinderClientInterface $factFinderClient)
25
    {
26
        $this->factFinderClient = $factFinderClient;
27
    }
28
29
    /**
30
     * @param array $parameters
31
     * @param \Symfony\Component\HttpFoundation\Request $request
32
     *
33
     * @return void
34
     */
35
    protected function addSessionId(array &$parameters, Request $request)
36
    {
37
        if (empty($parameters[FactFinderConstants::REQUEST_PARAMETER_SID])) {
38
            $parameters[FactFinderConstants::REQUEST_PARAMETER_SID] = $request->cookies->get(FactFinderConstants::COOKIE_SID_NAME);
39
        }
40
    }
41
}
42