CrefoPayPaymentMethodFilterPlugin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A filterPaymentMethods() 0 5 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\CrefoPay\Communication\Plugin;
9
10
use Generated\Shared\Transfer\PaymentMethodsTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PaymentMethodsTransfer 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...
11
use Generated\Shared\Transfer\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...
12
use Spryker\Zed\Kernel\Communication\AbstractPlugin;
13
use Spryker\Zed\Payment\Dependency\Plugin\Payment\PaymentMethodFilterPluginInterface;
14
15
/**
16
 * @method \SprykerEco\Zed\CrefoPay\Business\CrefoPayFacadeInterface getFacade()
17
 * @method \SprykerEco\Zed\CrefoPay\Communication\CrefoPayCommunicationFactory getFactory()
18
 * @method \SprykerEco\Zed\CrefoPay\CrefoPayConfig getConfig()
19
 *
20
 * @SuppressWarnings(PHPMD.NewPluginExtensionModuleRule)
21
 */
22
class CrefoPayPaymentMethodFilterPlugin extends AbstractPlugin implements PaymentMethodFilterPluginInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Spryker\Zed\Payment\Depe...odFilterPluginInterface has been deprecated: Use {@link \Spryker\Zed\PaymentExtension\Dependency\Plugin\PaymentMethodFilterPluginInterface} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

22
class CrefoPayPaymentMethodFilterPlugin extends AbstractPlugin implements /** @scrutinizer ignore-deprecated */ PaymentMethodFilterPluginInterface

This interface has been deprecated. The supplier of the interface has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.

Loading history...
23
{
24
    /**
25
     * {@inheritDoc}
26
     * - Takes allowed payment methods from the QuoteTransfer received in CreateTransaction API call.
27
     * - Filters payment methods based on allowed payment methods.
28
     *
29
     * @api
30
     *
31
     * @param \Generated\Shared\Transfer\PaymentMethodsTransfer $paymentMethodsTransfer
32
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
33
     *
34
     * @return \Generated\Shared\Transfer\PaymentMethodsTransfer
35
     */
36
    public function filterPaymentMethods(
37
        PaymentMethodsTransfer $paymentMethodsTransfer,
38
        QuoteTransfer $quoteTransfer
39
    ): PaymentMethodsTransfer {
40
        return $this->getFacade()->filterPaymentMethods($paymentMethodsTransfer, $quoteTransfer);
41
    }
42
}
43