Passed
Branch develop (7a155a)
by Gabriel
05:17
created

Gateway   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
eloc 7
c 1
b 0
f 1
dl 0
loc 30
ccs 0
cts 8
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setSandbox() 0 3 1
A isActive() 0 7 3
A getSandbox() 0 3 2
1
<?php
2
3
namespace ByTIC\Payments\Gateways\Providers\Paylike;
4
5
use ByTIC\Omnipay\Paylike\Gateway as AbstractGateway;
6
use ByTIC\Payments\Gateways\Providers\AbstractGateway\Traits\GatewayTrait;
7
8
/**
9
 * Class Gateway
10
 * @package ByTIC\Payments\Gateways\Providers\Paylike
11
 */
12
class Gateway extends AbstractGateway
13
{
14
    use GatewayTrait;
15
16
    /**
17
     * @inheritDoc
18
     */
19
    public function setSandbox($value)
20
    {
21
        return $this->setTestMode($value == 'yes');
22
    }
23
24
    /**
25
     * @inheritDoc
26
     */
27
    public function getSandbox()
28
    {
29
        return $this->getTestMode() === true ? 'yes' : 'no';
30
    }
31
32
    /**
33
     * @return bool
34
     */
35
    public function isActive()
36
    {
37
        if (strlen($this->getPublicKey()) >= 5 && strlen($this->getPrivateKey()) > 5) {
38
            return true;
39
        }
40
41
        return false;
42
    }
43
}
44