Completed
Push — develop ( f1dd75...9eb8ba )
by
unknown
13:58 queued 07:38
created

CustomObjectDeleteRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 25
loc 25
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A ofIdAndVersion() 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
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\CustomObjects;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractDeleteRequest;
10
11
/**
12
 * Class CustomObjectDeleteRequest
13
 */
14 View Code Duplication
class CustomObjectDeleteRequest extends AbstractDeleteRequest
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...
15
{
16
    protected $resultClass = '\Commercetools\Core\Model\CustomObject\CustomObject';
17
18
    /**
19
     * @param string $id
20
     * @param int $version
21
     * @param Context $context
22
     */
23
    public function __construct($id, $version, Context $context = null)
24
    {
25
        parent::__construct(CustomObjectsEndpoint::endpoint(), $id, $version, $context);
26
    }
27
28
    /**
29
     * @param string $id
30
     * @param int $version
31
     * @param Context $context
32
     * @return static
33
     */
34
    public static function ofIdAndVersion($id, $version, Context $context = null)
35
    {
36
        return new static($id, $version, $context);
37
    }
38
}
39
40