Completed
Push — develop ( dfae98...8b2ab3 )
by
unknown
17:22 queued 05:52
created

LineItemDraft::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 11
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 11
loc 11
ccs 0
cts 11
cp 0
rs 9.4286
cc 1
eloc 8
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * @author @ct-jensschulze <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Cart;
7
8
use Commercetools\Core\Model\Channel\ChannelReference;
9
use Commercetools\Core\Model\Common\JsonObject;
10
use Commercetools\Core\Model\Common\LocalizedString;
11
use Commercetools\Core\Model\Common\Money;
12
use Commercetools\Core\Model\Common\Price;
13
use Commercetools\Core\Model\Order\ItemState;
14
use Commercetools\Core\Model\Order\ItemStateCollection;
15
use Commercetools\Core\Model\Product\ProductVariant;
16
use Commercetools\Core\Model\TaxCategory\TaxRate;
17
use Commercetools\Core\Model\CustomField\CustomFieldObject;
18
19
/**
20
 * @package Commercetools\Core\Model\Cart
21
 * @apidoc http://dev.sphere.io/http-api-projects-carts.html#line-item
22
 * @method string getProductId()
23
 * @method LineItemDraft setProductId(string $productId = null)
24
 * @method int getVariantId()
25
 * @method LineItemDraft setVariantId(int $variantId = null)
26
 * @method int getQuantity()
27
 * @method LineItemDraft setQuantity(int $quantity = null)
28
 * @method ChannelReference getSupplyChannel()
29
 * @method LineItemDraft setSupplyChannel(ChannelReference $supplyChannel = null)
30
 * @method ChannelReference getDistributionChannel()
31
 * @method LineItemDraft setDistributionChannel(ChannelReference $distributionChannel = null)
32
 * @method CustomFieldObject getCustom()
33
 * @method LineItemDraft setCustom(CustomFieldObject $custom = null)
34
 */
35 View Code Duplication
class LineItemDraft 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
    public function fieldDefinitions()
38
    {
39
        return [
40
            'productId' => [static::TYPE => 'string'],
41
            'variantId' => [static::TYPE => 'int'],
42
            'quantity' => [static::TYPE => 'int'],
43
            'supplyChannel' => [static::TYPE => '\Commercetools\Core\Model\Channel\ChannelReference'],
44
            'distributionChannel' => [static::TYPE => '\Commercetools\Core\Model\Channel\ChannelReference'],
45
            'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject'],
46
        ];
47
    }
48
}
49