Completed
Push — master ( 3f2d2e...78eab5 )
by Jens
09:03
created

InventoryEntryDeletedMessage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 8 8 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
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Message;
7
8
use Commercetools\Core\Model\Common\DateTimeDecorator;
9
use Commercetools\Core\Model\Common\Reference;
10
use Commercetools\Core\Model\Order\Order;
11
use Commercetools\Core\Model\Channel\ChannelReference;
12
13
/**
14
 * @package Commercetools\Core\Model\Message
15
 * @link https://dev.commercetools.com/http-api-projects-messages.html#inventoryentrydeleted-message
16
 * @method string getId()
17
 * @method InventoryEntryDeletedMessage setId(string $id = null)
18
 * @method int getVersion()
19
 * @method InventoryEntryDeletedMessage setVersion(int $version = null)
20
 * @method DateTimeDecorator getCreatedAt()
21
 * @method InventoryEntryDeletedMessage setCreatedAt(\DateTime $createdAt = null)
22
 * @method DateTimeDecorator getLastModifiedAt()
23
 * @method InventoryEntryDeletedMessage setLastModifiedAt(\DateTime $lastModifiedAt = null)
24
 * @method int getSequenceNumber()
25
 * @method InventoryEntryDeletedMessage setSequenceNumber(int $sequenceNumber = null)
26
 * @method Reference getResource()
27
 * @method InventoryEntryDeletedMessage setResource(Reference $resource = null)
28
 * @method int getResourceVersion()
29
 * @method InventoryEntryDeletedMessage setResourceVersion(int $resourceVersion = null)
30
 * @method string getType()
31
 * @method InventoryEntryDeletedMessage setType(string $type = null)
32
 * @method string getSku()
33
 * @method InventoryEntryDeletedMessage setSku(string $sku = null)
34
 * @method ChannelReference getSupplyChannel()
35
 * @method InventoryEntryDeletedMessage setSupplyChannel(ChannelReference $supplyChannel = null)
36
 */
37 View Code Duplication
class InventoryEntryDeletedMessage extends Message
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...
38
{
39
    const MESSAGE_TYPE = 'InventoryEntryDeleted';
40
41
    public function fieldDefinitions()
42
    {
43
        $definitions = parent::fieldDefinitions();
44
        $definitions['sku'] = [static::TYPE => 'string'];
45
        $definitions['supplyChannel'] = [static::TYPE => '\Commercetools\Core\Model\Channel\ChannelReference'];
46
47
        return $definitions;
48
    }
49
}
50