PaymentService   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getPaymentPossibilities() 0 9 1
1
<?php
2
/**
3
 * PaymentService
4
 *
5
 * @author  Tim Lochmüller
6
 */
7
8
namespace FRUIT\Shopize\Service;
9
10
use FRUIT\Shopize\Utility\ComposerUtility;
11
use Omnipay\Omnipay;
12
13
/**
14
 * PaymentService
15
 */
16
class PaymentService
17
{
18
19
    /**
20
     * PaymentService constructor.
21
     */
22
    public function __construct()
23
    {
24
        ComposerUtility::checkContribLibs();
25
26
        // @todo check SSL connection here and drop a error (disable for debugging)
27
    }
28
29
    /**
30
     * Get payment possibilities
31
     *
32
     * @return array
33
     */
34
    public function getPaymentPossibilities()
35
    {
36
        $gatewayFactory = Omnipay::getFactory();
37
38
        return [
39
            $gatewayFactory->create('Dummy'),
40
            $gatewayFactory->create('PayPal_Express'),
41
        ];
42
    }
43
}
44