PaymentMethodContext   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMethod() 0 4 1
A setMethod() 0 4 1
1
<?php
2
3
/**
4
 * @author Rafał Muszyński <[email protected]>
5
 * @copyright 2015 Sourcefabric z.ú.
6
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
7
 */
8
namespace Newscoop\PaywallBundle\Services;
9
10
use Symfony\Component\HttpFoundation\Session\SessionInterface;
11
12
/**
13
 * Payment Context class.
14
 */
15
class PaymentMethodContext implements PaymentMethodInterface
16
{
17
    protected $session;
18
19
    /**
20
     * @param SessionInterface $session
21
     */
22
    public function __construct(SessionInterface $session)
23
    {
24
        $this->session = $session;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function getMethod()
31
    {
32
        return $this->session->get(self::METHOD_KEY);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function setMethod($method = null)
39
    {
40
        return $this->session->set(self::METHOD_KEY, $method);
41
    }
42
}
43