Passed
Push — master ( 209f8f...1618ee )
by Gabriel
06:05
created

Gateway::isActive()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
cc 3
nc 2
nop 0
crap 12
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