Completed
Pull Request — master (#76)
by
unknown
02:30
created

SendShipmentNotification   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
lcom 0
cbo 1
dl 26
loc 26
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 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
/**
3
 * Collmex SendShipmentNotification Type
4
 *
5
 * @author    Marcus Jaschen <[email protected]>
6
 * @author    René Galle <[email protected]>
7
 * @license   http://www.opensource.org/licenses/mit-license MIT License
8
 * @link      https://github.com/mjaschen/collmex
9
 */
10
11
namespace MarcusJaschen\Collmex\Type;
12
13
/**
14
 * Collmex SendShipmentNotification Type
15
 *
16
 * @author   Marcus Jaschen <[email protected]>
17
 * @author   René Galle <[email protected]>
18
 * @license  http://www.opensource.org/licenses/mit-license MIT License
19
 * @link     https://github.com/mjaschen/collmex
20
 *
21
 * @property $type_identifier
22
 * @property $delivery_id
23
 * @property $client_id
24
 * @property $customer_id
25
 * @property $mode_of_shipment
26
 * @property $sent_to_shipment_company
27
 * @property $tracking_code
28
 * @property $delivery_date_from
29
 */
30 View Code Duplication
class SendShipmentNotification extends AbstractType implements TypeInterface
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...
31
{
32
    /**
33
     * @var array
34
     */
35
    protected $template = [
36
        'type_identifier'          => 'SHIPMENT_NOTIFICATION_SEND',
37
        'delivery_id'              => null,
38
        'client_id'                => null,
39
        'customer_id'              => null,
40
        'mode_of_shipment'         => null,
41
        'sent_to_shipment_company' => null,
42
        'tracking_code'            => null,
43
        'delivery_date_from'       => null,
44
    ];
45
46
    /**
47
     * Formally validates the type data in $data attribute.
48
     *
49
     * @return bool Validation success
50
     */
51
    public function validate()
52
    {
53
        return true;
54
    }
55
}
56