AddUserRequestDataTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 13
Ratio 100 %

Importance

Changes 0
Metric Value
dl 13
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace OmnideskBundle\DataTransformer\Request\User;
3
4
use OmnideskBundle\DataTransformer\DataTransformerInterface;
5
use OmnideskBundle\Request\User\AddUserRequest;
6
7
/**
8
 * Class AddUserRequestDataTransformer
9
 * @package OmnideskBundle\DataTransformer\Request
10
 */
11 View Code Duplication
class AddUserRequestDataTransformer implements DataTransformerInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     * @param AddUserRequest $value
15
     * @return array
16
     */
17
    public function transform($value)
18
    {
19
        return [
20
            'user_email' => $value->getEmail(),
21
            'user_phone' => $value->getPhone(),
22
            'user_full_name' => $value->getFullName(),
23
            'company_name' => $value->getCompanyName(),
24
            'company_position' => $value->getCompanyPosition(),
25
            'user_note' => $value->getNote(),
26
            'language_id' => $value->getLanguageId(),
27
            'custom_fields' => $value->getCustomFields(),
28
        ];
29
    }
30
31
    /**
32
     * @param array $value
33
     * @return AddUserRequest
34
     */
35
    public function reverseTransform($value)
36
    {
37
        throw new \LogicException('Method not implemented.');
38
    }
39
}
40