Issues (1092)

Model/Plugins/ShippingInformationManagement.php (5 issues)

1
<?php
2
3
namespace Payone\Core\Model\Plugins;
4
5
use Magento\Checkout\Model\ShippingInformationManagement as ShippingInformationManagementOrig;
0 ignored issues
show
The type Magento\Checkout\Model\S...ngInformationManagement 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...
6
use Magento\Checkout\Api\Data\ShippingInformationInterface;
0 ignored issues
show
The type Magento\Checkout\Api\Dat...ingInformationInterface 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...
7
8
/**
9
 * Plugin for Magentos ShippingInformationManagement class
10
 */
11
class ShippingInformationManagement
12
{
13
    /**
14
     * Checkout session model
15
     *
16
     * @var \Magento\Checkout\Model\Session
0 ignored issues
show
The type Magento\Checkout\Model\Session 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...
17
     */
18
    protected $checkoutSession;
19
20
    /**
21
     * Constructor
22
     *
23
     * @param \Magento\Checkout\Model\Session $checkoutSession
24
     */
25
    public function __construct(\Magento\Checkout\Model\Session $checkoutSession) {
26
        $this->checkoutSession = $checkoutSession;
27
    }
28
29
    /**
30
     * Writes extensionAttributes to session for later use in Consumerscore
31
     *
32
     * @param ShippingInformationManagementOrig $oSource
33
     * @param int $cartId
34
     * @param ShippingInformationInterface $addressInformation
35
     * @return null
36
     */
37
    public function beforeSaveAddressInformation(ShippingInformationManagementOrig $oSource, $cartId, ShippingInformationInterface $addressInformation)
0 ignored issues
show
The parameter $oSource is not used and could be removed. ( Ignorable by Annotation )

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

37
    public function beforeSaveAddressInformation(/** @scrutinizer ignore-unused */ ShippingInformationManagementOrig $oSource, $cartId, ShippingInformationInterface $addressInformation)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $cartId is not used and could be removed. ( Ignorable by Annotation )

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

37
    public function beforeSaveAddressInformation(ShippingInformationManagementOrig $oSource, /** @scrutinizer ignore-unused */ $cartId, ShippingInformationInterface $addressInformation)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
    {
39
        $address = $addressInformation->getShippingAddress();
40
        $extensionAttributes = $address->getExtensionAttributes();
41
        if (!empty($extensionAttributes->getGender())) {
42
            $this->checkoutSession->setPayoneGuestGender($extensionAttributes->getGender());
43
        }
44
        if (!empty($extensionAttributes->getDateofbirth())) {
45
            $this->checkoutSession->setPayoneGuestDateofbirth($extensionAttributes->getDateofbirth());
46
        }
47
        return null;
48
    }
49
}
50