GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( e4b67a...d8327a )
by Andreas
03:56
created

ImportButton::getImportUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaign\Block\Adminhtml\Contact;
7
8
use Magento\Backend\Block\Widget\Context;
9
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
10
11
/**
12
 * Class ImportButton
13
 */
14
class ImportButton implements ButtonProviderInterface
15
{
16
    /**
17
     * @var Context
18
     */
19
    private $context;
20
21
    /**
22
     * @param Context $context
23
     */
24
    public function __construct(
25
        Context $context
26
    ) {
27
        $this->context = $context;
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33
    public function getButtonData()
34
    {
35
        return [
36
            'label' => __('Import Contacts'),
37
            'class' => 'primary',
38
            'on_click' => 'deleteConfirm(\'' . __(
39
                    'Are you sure you want to do this?'
40
                ) . '\', \'' . $this->getImportUrl() . '\', {"data": {}})',
41
        ];
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    private function getImportUrl(): string
48
    {
49
        return $this->context->getUrlBuilder()->getUrl('*/*/import');
50
    }
51
}
52