ApiContextMapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A mapCmsSlotContentRequestToCoremediaFragmentRequest() 0 7 1
A mapCoremediaApiResponseTransferToCmsSlotContentResponseTransfer() 0 4 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Coremedia\Mapper;
9
10
use Generated\Shared\Transfer\CmsSlotContentRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...tContentRequestTransfer 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 Generated\Shared\Transfer\CmsSlotContentResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ContentResponseTransfer 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...
12
use Generated\Shared\Transfer\CoremediaApiResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ediaApiResponseTransfer 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...
13
use Generated\Shared\Transfer\CoremediaFragmentRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...FragmentRequestTransfer 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...
14
15
class ApiContextMapper implements ApiContextMapperInterface
16
{
17
    /**
18
     * @param \Generated\Shared\Transfer\CmsSlotContentRequestTransfer $cmsSlotContentRequestTransfer
19
     *
20
     * @return \Generated\Shared\Transfer\CoremediaFragmentRequestTransfer
21
     */
22
    public function mapCmsSlotContentRequestToCoremediaFragmentRequest(
23
        CmsSlotContentRequestTransfer $cmsSlotContentRequestTransfer
24
    ): CoremediaFragmentRequestTransfer {
25
        return (new CoremediaFragmentRequestTransfer())
26
            ->fromArray($cmsSlotContentRequestTransfer->getParams(), true)
27
            ->requireStore()
28
            ->requireLocale();
29
    }
30
31
    /**
32
     * @param \Generated\Shared\Transfer\CoremediaApiResponseTransfer $coreMediaApiResponseTransfer
33
     *
34
     * @return \Generated\Shared\Transfer\CmsSlotContentResponseTransfer
35
     */
36
    public function mapCoremediaApiResponseTransferToCmsSlotContentResponseTransfer(
37
        CoremediaApiResponseTransfer $coreMediaApiResponseTransfer
38
    ): CmsSlotContentResponseTransfer {
39
        return (new CmsSlotContentResponseTransfer())->setContent($coreMediaApiResponseTransfer->getData());
40
    }
41
}
42