Passed
Push — master ( 6e2a06...da0795 )
by Jens
14:26
created

DiscountCodeNonApplicableError   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 16
dl 0
loc 24
c 0
b 0
f 0
ccs 0
cts 15
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 20 1
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Error;
7
8
use Commercetools\Core\Model\Common\DateTimeDecorator;
9
use DateTime;
10
11
/**
12
 * @package Commercetools\Core\Error
13
 *
14
 * @method string getCode()
15
 * @method DiscountCodeNonApplicableError setCode(string $code = null)
16
 * @method string getMessage()
17
 * @method DiscountCodeNonApplicableError setMessage(string $message = null)
18
 * @method string getDiscountCode()
19
 * @method DiscountCodeNonApplicableError setDiscountCode(string $discountCode = null)
20
 * @method string getReason()
21
 * @method DiscountCodeNonApplicableError setReason(string $reason = null)
22
 * @method string getDicountCodeId()
23
 * @method DiscountCodeNonApplicableError setDicountCodeId(string $dicountCodeId = null)
24
 * @method DateTimeDecorator getValidFrom()
25
 * @method DiscountCodeNonApplicableError setValidFrom(DateTime $validFrom = null)
26
 * @method DateTimeDecorator getValidUntil()
27
 * @method DiscountCodeNonApplicableError setValidUntil(DateTime $validUntil = null)
28
 * @method DateTimeDecorator getValidityCheckTime()
29
 * @method DiscountCodeNonApplicableError setValidityCheckTime(DateTime $validityCheckTime = null)
30
 */
31
class DiscountCodeNonApplicableError extends ApiError
32
{
33
    const CODE = 'DiscountCodeNonApplicable';
34
35
    public function fieldDefinitions()
36
    {
37
        $definitions = parent::fieldDefinitions();
38
        $definitions['discountCode'] = [static::TYPE => 'string'];
39
        $definitions['reason'] = [static::TYPE => 'string'];
40
        $definitions['dicountCodeId'] = [static::TYPE => 'string'];
41
        $definitions['validFrom'] = [
42
            static::TYPE => DateTime::class,
43
            static::DECORATOR => DateTimeDecorator::class
44
        ];
45
        $definitions['validUntil'] = [
46
            static::TYPE => DateTime::class,
47
            static::DECORATOR => DateTimeDecorator::class
48
        ];
49
        $definitions['validityCheckTime'] = [
50
            static::TYPE => DateTime::class,
51
            static::DECORATOR => DateTimeDecorator::class
52
        ];
53
54
        return $definitions;
55
    }
56
}
57