FactFinderNgTrackCartAdapter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 12
c 1
b 0
f 0
dl 0
loc 36
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getChannel() 0 3 1
A getMethod() 0 3 1
A getUrl() 0 10 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Client\FactFinderNg\Api\Adapter\Http;
9
10
use Generated\Shared\Transfer\FactFinderNgRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...FinderNgRequestTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Symfony\Component\HttpFoundation\Request;
12
13
class FactFinderNgTrackCartAdapter extends FactFinderAbstractAdapter
14
{
15
    protected const FACT_FINDER_URL_CART = 'cart';
16
17
    /**
18
     * @param \Generated\Shared\Transfer\FactFinderNgRequestTransfer $factFinderNgRequestTransfer
19
     *
20
     * @return string
21
     */
22
    protected function getUrl(FactFinderNgRequestTransfer $factFinderNgRequestTransfer): string
23
    {
24
        return sprintf(
25
            '%s/%s/%s/%s/%s/%s',
26
            $this->config->getFactFinderUrl(),
27
            static::FACT_FINDER_URL_TYPE_URL,
28
            static::FACT_FINDER_URL_VERSION,
29
            static::FACT_FINDER_URL_TRACK,
30
            $this->getChannel(),
31
            static::FACT_FINDER_URL_CART
32
        );
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    protected function getMethod(): string
39
    {
40
        return Request::METHOD_POST;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    protected function getChannel(): string
47
    {
48
        return $this->config->getFactFinderChannel();
49
    }
50
}
51