RatepayHandlerPlugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setFlashMessenger() 0 5 1
A addToDataClass() 0 3 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Ratepay\Plugin;
9
10
use Spryker\Shared\Kernel\Transfer\AbstractTransfer;
11
use Spryker\Yves\Kernel\AbstractPlugin;
12
use Spryker\Yves\Messenger\FlashMessenger\FlashMessengerInterface;
13
use Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginWithMessengerInterface;
14
use Symfony\Component\HttpFoundation\Request;
15
16
/**
17
 * @method \SprykerEco\Yves\Ratepay\RatepayFactory getFactory()
18
 */
19
class RatepayHandlerPlugin extends AbstractPlugin implements StepHandlerPluginWithMessengerInterface
20
{
21
    /**
22
     * @var \Spryker\Yves\Messenger\FlashMessenger\FlashMessengerInterface
23
     */
24
    protected $flashMessenger;
25
26
    /**
27
     * @param \Spryker\Yves\Messenger\FlashMessenger\FlashMessengerInterface $flashMessenger
28
     *
29
     * @return $this
30
     */
31
    public function setFlashMessenger(FlashMessengerInterface $flashMessenger)
32
    {
33
        $this->flashMessenger = $flashMessenger;
34
35
        return $this;
36
    }
37
38
    /**
39
     * @param \Symfony\Component\HttpFoundation\Request $request
40
     * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer|\Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
41
     *
42
     * @return \Generated\Shared\Transfer\QuoteTransfer
43
     */
44
    public function addToDataClass(Request $request, AbstractTransfer $quoteTransfer)
45
    {
46
        return $this->getFactory()->createRatepayHandler()->addPaymentToQuote($request, $quoteTransfer, $this->flashMessenger);
47
    }
48
}
49