Issues (570)

Block/Customer/CardRenderer.php (2 issues)

Labels
Severity
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
namespace Moip\Magento2\Block\Customer;
10
11
use Magento\Vault\Api\Data\PaymentTokenInterface;
0 ignored issues
show
The type Magento\Vault\Api\Data\PaymentTokenInterface 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 Magento\Vault\Block\AbstractCardRenderer;
0 ignored issues
show
The type Magento\Vault\Block\AbstractCardRenderer 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...
13
use Moip\Magento2\Model\Ui\ConfigProviderBase;
14
15
class CardRenderer extends AbstractCardRenderer
16
{
17
    /**
18
     * Can render specified token.
19
     *
20
     * @param PaymentTokenInterface $token
21
     *
22
     * @return bool
23
     */
24
    public function canRender(PaymentTokenInterface $token): bool
25
    {
26
        return $token->getPaymentMethodCode() === ConfigProviderBase::METHOD_CODE_CC;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getNumberLast4Digits(): string
33
    {
34
        return $this->getTokenDetails()['cc_last4'];
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getExpDate(): string
41
    {
42
        return $this->getTokenDetails()['cc_exp_month'].'/'.$this->getTokenDetails()['cc_exp_year'];
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getIconUrl(): string
49
    {
50
        return $this->getIconForType($this->getTokenDetails()['cc_type'])['url'];
51
    }
52
53
    /**
54
     * @return int
55
     */
56
    public function getIconHeight(): int
57
    {
58
        return $this->getIconForType($this->getTokenDetails()['cc_type'])['height'];
59
    }
60
61
    /**
62
     * @return int
63
     */
64
    public function getIconWidth(): int
65
    {
66
        return $this->getIconForType($this->getTokenDetails()['cc_type'])['width'];
67
    }
68
}
69