CpeSwfHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
1
<?php
2
3
namespace SA\CpeSdk\Swf;
4
5
use Aws\Swf\SwfClient;
6
7
// SA Cpe SDK
8
use SA\CpeSdk;
9
10
/**
11
 * Create the AWS SWF connection
12
 * Check for AWS environment variables
13
 */
14
class CpeSwfHandler
15
{
16
    public $swf;
17
18
    public function __construct()
19
    {
20
        # Check if preper env vars are setup
21
        if (!($region = getenv("AWS_DEFAULT_REGION")))
22
            throw new CpeSdk\CpeException("Set 'AWS_DEFAULT_REGION' environment variable!");
23
24
        // SWF client
25
        $this->swf = SwfClient::factory(array(
26
            'region'  => $region
27
        ));
28
    }
29
}