AbstractBraintreeService   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 41
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
1
<?php
2
3
namespace App\Service\Braintree;
4
5
use App\Service\SettingsService;
6
use Braintree\Gateway;
7
use Psr\Log\LoggerInterface;
8
9
/**
10
 * Class AbstractBraintreeService
11
 * @package App\Service\Braintree
12
 */
13
abstract class AbstractBraintreeService
14
{
15
    /**
16
     * @var LoggerInterface
17
     */
18
    protected $logger;
19
20
    /**
21
     * @var Gateway
22
     */
23
    protected $gateway;
24
25
    /**
26
     * @var SettingsService
27
     */
28
    protected $settingsService;
29
30
    /**
31
     * AbstractBraintreeService constructor.
32
     * @param string $environment
33
     * @param string $merchantId
34
     * @param string $publicKey
35
     * @param string $privateKey
36
     * @param LoggerInterface $logger
37
     */
38
    public function __construct(
39
        string $environment,
40
        string $merchantId,
41
        string $publicKey,
42
        string $privateKey,
43
        LoggerInterface $logger,
44
        SettingsService $settingsService
45
    ) {
46
        $this->logger = $logger;
47
        $this->gateway = new Gateway([
48
            'environment' => $environment,
49
            'merchantId' => $merchantId,
50
            'publicKey' => $publicKey,
51
            'privateKey' => $privateKey
52
        ]);
53
        $this->settingsService = $settingsService;
54
    }
55
}
56