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

AzureServiceBusDestination   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 27.27%

Importance

Changes 0
Metric Value
wmc 3
eloc 10
dl 0
loc 33
ccs 3
cts 11
cp 0.2727
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 5 1
A ofConnectionString() 0 5 1
A ofQueueURLAccessKeyAndSecret() 0 5 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 AzureServiceBusDestination setType(string $type = null)
15
 * @method string getConnectionString()
16
 * @method AzureServiceBusDestination setConnectionString(string $connectionString = null)
17
 */
18
class AzureServiceBusDestination extends Destination
19
{
20 1
    public function fieldDefinitions()
21
    {
22
        return [
23 1
            'type' => [static::TYPE => 'string'],
24 1
            'connectionString' => [static::TYPE => 'string'],
25
        ];
26
    }
27
28
    /**
29
     * @deprecated use ofConnectionString instead
30
     * @param string $connectionString
31
     * @param Context|null $context
32
     * @return AzureServiceBusDestination
33
     */
34
    public static function ofQueueURLAccessKeyAndSecret($connectionString, Context $context = null)
35
    {
36
        return static::of($context)
37
            ->setType(static::DESTINATION_AZURE_SERVICE_BUS)
38
            ->setConnectionString($connectionString);
39
    }
40
41
    /**
42
     * @param string $connectionString
43
     * @param Context|null $context
44
     * @return AzureServiceBusDestination
45
     */
46
    public static function ofConnectionString($connectionString, Context $context = null)
47
    {
48
        return static::of($context)
49
            ->setType(static::DESTINATION_AZURE_SERVICE_BUS)
50
            ->setConnectionString($connectionString);
51
    }
52
}
53