Completed
Pull Request — master (#24)
by Rafał
03:08
created

PaymentMethodContext::getMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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