Issues (570)

Model/GuestMoipInterestManagement.php (3 issues)

1
<?php
2
/**
3
 * Copyright © Wirecard Brasil. All rights reserved.
4
 *
5
 * @author    Bruno Elisei <[email protected]>
6
 * See COPYING.txt for license details.
7
 */
8
9
declare(strict_types=1);
10
11
namespace Moip\Magento2\Model;
12
13
use Magento\Quote\Model\QuoteIdMaskFactory;
0 ignored issues
show
The type Magento\Quote\Model\QuoteIdMaskFactory 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...
14
use Moip\Magento2\Api\Data\MoipInterestInterface;
15
use Moip\Magento2\Api\GuestMoipInterestManagementInterface;
16
use Moip\Magento2\Api\MoipInterestManagementInterface;
17
18
/**
19
 * Class MoipInterestManagement - Calc Insterest by Installment.
20
 */
21
class GuestMoipInterestManagement implements GuestMoipInterestManagementInterface
22
{
23
    /**
24
     * @var \Magento\Quote\Model\QuoteIdMaskFactory
25
     */
26
    protected $quoteIdMaskFactory;
27
28
    /**
29
     * @var \Magento\Checkout\Api\ShippingInformationManagementInterface
0 ignored issues
show
The type Magento\Checkout\Api\Shi...tionManagementInterface 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...
30
     */
31
    protected $moipInterestInterface;
32
33
    /**
34
     * @param \Magento\Quote\Model\QuoteIdMaskFactory            $quoteIdMaskFactory
35
     * @param \Moip\Magento2\Api\MoipInterestManagementInterface $moipInterestInterface
36
     * @codeCoverageIgnore
37
     */
38
    public function __construct(
39
        QuoteIdMaskFactory $quoteIdMaskFactory,
40
        MoipInterestManagementInterface $moipInterestInterface
41
    ) {
42
        $this->quoteIdMaskFactory = $quoteIdMaskFactory;
43
        $this->moipInterestInterface = $moipInterestInterface;
0 ignored issues
show
Documentation Bug introduced by
It seems like $moipInterestInterface of type Moip\Magento2\Api\MoipInterestManagementInterface is incompatible with the declared type Magento\Checkout\Api\Shi...tionManagementInterface of property $moipInterestInterface.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
44
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49
    public function saveMoipInterest(
50
        $cartId,
51
        MoipInterestInterface $moipInterest
52
    ) {
53
        /** @var $quoteIdMask \Magento\Quote\Model\QuoteIdMask */
54
        $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
55
56
        return $this->moipInterestInterface->saveMoipInterest(
57
            $quoteIdMask->getQuoteId(),
58
            $moipInterest
59
        );
60
    }
61
}
62