Passed
Branch php-scrutinizer (9ddcba)
by Jens
09:45
created

SubscriptionUpdateByKeyRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ofKeyAndVersion() 0 3 1
A __construct() 0 3 1
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Subscriptions;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Subscription\Subscription;
10
use Commercetools\Core\Request\AbstractUpdateByKeyRequest;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
use Commercetools\Core\Model\MapperInterface;
13
14
/**
15
 * @package Commercetools\Core\Request\Subscriptions
16
 * @link https://docs.commercetools.com/http-api-projects-subscriptions.html#update-subscription-by-key
17
 * @method Subscription mapResponse(ApiResponseInterface $response)
18
 * @method Subscription mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class SubscriptionUpdateByKeyRequest extends AbstractUpdateByKeyRequest
21
{
22
    protected $resultClass = Subscription::class;
23
24
    /**
25
     * @param string $key
26
     * @param string $version
27
     * @param array $actions
28
     * @param Context $context
29
     */
30
    public function __construct($key, $version, array $actions = [], Context $context = null)
31
    {
32
        parent::__construct(SubscriptionsEndpoint::endpoint(), $key, $version, $actions, $context);
0 ignored issues
show
Bug introduced by
$version of type string is incompatible with the type integer expected by parameter $version of Commercetools\Core\Reque...eRequest::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

32
        parent::__construct(SubscriptionsEndpoint::endpoint(), $key, /** @scrutinizer ignore-type */ $version, $actions, $context);
Loading history...
33
    }
34
35
    /**
36
     * @param string $key
37
     * @param int $version
38
     * @param Context $context
39
     * @return static
40
     */
41
    public static function ofKeyAndVersion($key, $version, Context $context = null)
42
    {
43
        return new static($key, $version, [], $context);
44
    }
45
}
46