Completed
Push — develop ( e4c10e...940e90 )
by Jens
08:29
created

CustomLineItemDraft::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 12
loc 12
ccs 8
cts 8
cp 1
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Cart;
7
8
use Commercetools\Core\Model\Common\JsonObject;
9
use Commercetools\Core\Model\Common\LocalizedString;
10
use Commercetools\Core\Model\Common\Money;
11
use Commercetools\Core\Model\Order\ItemState;
12
use Commercetools\Core\Model\TaxCategory\TaxCategoryReference;
13
use Commercetools\Core\Model\TaxCategory\TaxRate;
14
use Commercetools\Core\Model\CustomField\CustomFieldObject;
15
use Commercetools\Core\Model\TaxCategory\ExternalTaxRateDraft;
16
17
/**
18
 * @package Commercetools\Core\Model\Cart
19
 * @link https://dev.commercetools.com/http-api-projects-carts.html#custom-line-item-draft
20
 * @method LocalizedString getName()
21
 * @method CustomLineItemDraft setName(LocalizedString $name = null)
22
 * @method Money getMoney()
23
 * @method CustomLineItemDraft setMoney(Money $money = null)
24
 * @method string getSlug()
25
 * @method CustomLineItemDraft setSlug(string $slug = null)
26
 * @method int getQuantity()
27
 * @method CustomLineItemDraft setQuantity(int $quantity = null)
28
 * @method TaxCategoryReference getTaxCategory()
29
 * @method CustomLineItemDraft setTaxCategory(TaxCategoryReference $taxCategory = null)
30
 * @method CustomFieldObject getCustom()
31
 * @method CustomLineItemDraft setCustom(CustomFieldObject $custom = null)
32
 * @method ExternalTaxRateDraft getExternalTaxRate()
33
 * @method CustomLineItemDraft setExternalTaxRate(ExternalTaxRateDraft $externalTaxRate = null)
34
 */
35 View Code Duplication
class CustomLineItemDraft extends JsonObject
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...
36
{
37 1
    public function fieldDefinitions()
38
    {
39
        return [
40 1
            'name' => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString'],
41 1
            'money' => [static::TYPE => '\Commercetools\Core\Model\Common\Money'],
42 1
            'slug' => [static::TYPE => 'string'],
43 1
            'quantity' => [static::TYPE => 'int'],
44 1
            'taxCategory' => [static::TYPE => '\Commercetools\Core\Model\TaxCategory\TaxCategoryReference'],
45 1
            'externalTaxRate' => [static::TYPE => '\Commercetools\Core\Model\TaxCategory\ExternalTaxRateDraft'],
46 1
            'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject'],
47
        ];
48
    }
49
}
50