Passed
Branch master (fbf0a6)
by Volodymyr
04:04
created

General   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getToken() 0 3 1
A __construct() 0 6 1
1
<?php
2
/**
3
 * Copyright (c) 2019. Volodymyr Hryvinskyi.  All rights reserved.
4
 * @author: <mailto:[email protected]>
5
 * @github: <https://github.com/hryvinskyi>
6
 */
7
8
namespace Hryvinskyi\InvisibleCaptcha\Model\Provider\TokenResponse;
9
10
use Hryvinskyi\InvisibleCaptcha\Model\Provider\TokenResponseInterface;
11
use Magento\Framework\App\RequestInterface;
12
use Magento\Framework\Message\ManagerInterface;
13
14
class General implements TokenResponseInterface
15
{
16
    /**
17
     * @var RequestInterface
18
     */
19
    private $request;
20
21
    /**
22
     * @var ManagerInterface
23
     */
24
    private $messageManager;
25
26
    /**
27
     * DefaultResponseProvider constructor.
28
     *
29
     * @param RequestInterface $request
30
     * @param ManagerInterface $messageManager
31
     */
32
    public function __construct(
33
        RequestInterface $request,
34
        ManagerInterface $messageManager
35
    ) {
36
        $this->request = $request;
37
        $this->messageManager = $messageManager;
38
    }
39
40
    /**
41
     * @inheritDoc
42
     */
43
    public function getToken(): ?string
44
    {
45
        return $this->request->getParam('hryvinskyi_invisible_token');
46
    }
47
}
48