SubscriptionReference   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 23
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ofId() 0 3 1
A ofKey() 0 3 1
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 * @created: 27.01.15, 18:22
5
 */
6
7
namespace Commercetools\Core\Model\Subscription;
8
9
use Commercetools\Core\Model\Common\Context;
10
use Commercetools\Core\Model\Common\Reference;
11
12
/**
13
 * @package Commercetools\Core\Model\Subscription
14
 * @ramlTestIgnoreClass
15
 * @link https://docs.commercetools.com/http-api-types.html#reference-types
16
 * @link https://docs.commercetools.com/http-api-projects-subscriptions.html#subscription
17
 * @method string getTypeId()
18
 * @method SubscriptionReference setTypeId(string $typeId = null)
19
 * @method string getId()
20
 * @method SubscriptionReference setId(string $id = null)
21
 * @method string getKey()
22
 * @method SubscriptionReference setKey(string $key = null)
23
 * @method Subscription getObj()
24
 * @method SubscriptionReference setObj(Subscription $obj = null)
25
 */
26
class SubscriptionReference extends Reference
27
{
28
    const TYPE_SUBSCRIPTION = 'subscription';
29
    const TYPE_CLASS = Subscription::class;
30
31
    /**
32
     * @param $id
33
     * @param Context|callable $context
34
     * @return SubscriptionReference
35
     */
36
    public static function ofId($id, $context = null)
37
    {
38
        return static::ofTypeAndId(static::TYPE_SUBSCRIPTION, $id, $context);
39
    }
40
41
    /**
42
     * @param $key
43
     * @param Context|callable $context
44
     * @return SubscriptionReference
45
     */
46
    public static function ofKey($key, $context = null)
47
    {
48
        return static::ofTypeAndKey(static::TYPE_SUBSCRIPTION, $key, $context);
49
    }
50
}
51