Passed
Push — master ( 6c42be...776013 )
by Igor
02:03
created

InventoryChangedEntity   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 31
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRequired() 0 5 1
1
<?php
2
/**
3
 * PHP version 5.4 and 7
4
 *
5
 * @package   Payever\Inventory
6
 * @author    Hennadii.Shymanskyi <[email protected]>
7
 * @copyright 2017-2019 payever GmbH
8
 * @license   MIT <https://opensource.org/licenses/MIT>
9
 */
10
11
namespace Payever\ExternalIntegration\Inventory\Http\MessageEntity;
12
13
use Payever\ExternalIntegration\Core\Base\MessageEntity;
14
15
/**
16
 * PHP version 5.4 and 7
17
 *
18
 * @package   Payever\Inventory
19
 * @author    Hennadii.Shymanskyi <[email protected]>
20
 * @copyright 2017-2019 payever GmbH
21
 * @license   MIT <https://opensource.org/licenses/MIT>
22
 *
23
 * @method string getSku()
24
 * @method int|null getQuantity()
25
 * @method int getStock()
26
 *
27
 * @method self setSku(string $sku)
28
 * @method self setQuantity(int $quantity)
29
 * @method self setStock(int $stock)
30
 */
31
class InventoryChangedEntity extends MessageEntity
32
{
33
    /**
34
     * Target product SKU
35
     *
36
     * @var string
37
     */
38
    protected $sku;
39
40
    /**
41
     * Diff between previous and current states (+/-)
42
     *
43
     * @var int|null
44
     */
45
    protected $quantity;
46
47
    /**
48
     * Actual quantity after this action
49
     *
50
     * @var int
51
     */
52
    protected $stock;
53
54
    /**
55
     * @return array
56
     */
57
    public function getRequired()
58
    {
59
        return array(
60
            'sku',
61
            'stock',
62
        );
63
    }
64
}
65