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

AzureEventGridDestination::ofUriAndAccessKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 2
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