OrderMapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 16 2
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\Zed\Sevensenders\Business\Mapper;
9
10
use Generated\Shared\Transfer\OrderTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\OrderTransfer 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\SevensendersRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...nsendersRequestTransfer 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
13
class OrderMapper implements MapperInterface
14
{
15
    /**
16
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
17
     *
18
     * @return \Generated\Shared\Transfer\SevensendersRequestTransfer
19
     */
20
    public function map(OrderTransfer $orderTransfer): SevensendersRequestTransfer
21
    {
22
        $payload = [
23
            'order_id' => (string)$orderTransfer->getIdSalesOrder(),
24
            'order_url' => '',
25
            'order_date' => $orderTransfer->getCreatedAt(),
26
            'delivered_with_seven_senders' => true,
27
            'boarding_complete' => true,
28
            'language' => $orderTransfer->getLocale() ? $orderTransfer->getLocale()->getLocaleName() : '',
29
            'promised_delivery_date' => $orderTransfer->getShipmentDeliveryTime(),
30
        ];
31
32
        $transfer = new SevensendersRequestTransfer();
33
        $transfer->setPayload($payload);
34
35
        return $transfer;
36
    }
37
}
38