AddUserRequestDataTransformer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 29
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A transform() 13 13 1
A reverseTransform() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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