AbstractDataProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 25
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addSessionId() 0 4 2
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