Completed
Push — develop ( 641d0b...7172e1 )
by Jens
11:21
created

ResourceUpdatedDelivery   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 10
loc 10
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 7 7 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 @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Subscription;
7
8
use Commercetools\Core\Model\Common\Reference;
9
10
/**
11
 * @package Commercetools\Core\Model\Subscription
12
 * @method string getProjectKey()
13
 * @method ResourceUpdatedDelivery setProjectKey(string $projectKey = null)
14
 * @method string getNotificationType()
15
 * @method ResourceUpdatedDelivery setNotificationType(string $notificationType = null)
16
 * @method Reference getResource()
17
 * @method ResourceUpdatedDelivery setResource(Reference $resource = null)
18
 * @method int getVersion()
19
 * @method ResourceUpdatedDelivery setVersion(int $version = null)
20
 * @method int getOldVersion()
21
 * @method ResourceUpdatedDelivery setOldVersion(int $oldVersion = null)
22
 */
23 View Code Duplication
class ResourceUpdatedDelivery extends Delivery
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...
24
{
25 1
    public function fieldDefinitions()
26
    {
27 1
        $definition = parent::fieldDefinitions();
28 1
        $definition['version'] = [static::TYPE => 'int'];
29 1
        $definition['oldVersion'] = [static::TYPE => 'int'];
30 1
        return $definition;
31
    }
32
}
33