Passed
Push — master ( 18b32f...fa2b73 )
by Jens
08:15
created

AzureEventGridDestination   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 44.44%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ofUriAndAccessKey() 0 6 1
A fieldDefinitions() 0 6 1
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Subscription;
7
8
use Commercetools\Core\Model\Common\Context;
9
10
/**
11
 * @package Commercetools\Core\Model\Subscription
12
 *
13
 * @method string getType()
14
 * @method AzureEventGridDestination setType(string $type = null)
15
 * @method string getUri()
16
 * @method AzureEventGridDestination setUri(string $uri = null)
17
 * @method string getAccessKey()
18
 * @method AzureEventGridDestination setAccessKey(string $accessKey = null)
19
 */
20
class AzureEventGridDestination extends Destination
21
{
22 1
    public function fieldDefinitions()
23
    {
24
        return [
25 1
            'type' => [static::TYPE => 'string'],
26 1
            'uri' => [static::TYPE => 'string'],
27 1
            'accessKey' => [static::TYPE => 'string'],
28
        ];
29
    }
30
31
    /**
32
     * @param $uri
33
     * @param $accessKey
34
     * @param Context|null $context
35
     * @return AzureServiceBusDestination
36
     */
37
    public static function ofUriAndAccessKey($uri, $accessKey, Context $context = null)
38
    {
39
        return static::of($context)
0 ignored issues
show
Bug Best Practice introduced by
The expression return static::of($conte...etAccessKey($accessKey) returns the type Commercetools\Core\Model...ureEventGridDestination which is incompatible with the documented return type Commercetools\Core\Model...reServiceBusDestination.
Loading history...
40
            ->setType(static::DESTINATION_AZURE_EVENT_GRID)
41
            ->setUri($uri)
42
            ->setAccessKey($accessKey);
43
    }
44
}
45