Form::updateSaveButton()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * File: Form.php
7
 *
8
 * @author Maciej Sławik <[email protected]>
9
 * @copyright Copyright (C) 2019 Lizard Media (http://lizardmedia.pl)
10
 */
11
12
namespace LizardMedia\VarnishWarmer\Block\Adminhtml\PurgeMultiple;
13
14
use Magento\Backend\Block\Widget\Form\Container;
15
use Magento\Framework\Phrase;
16
17
/**
18
 * Class Form
19
 * @package LizardMedia\VarnishWarmer\Block\PurgeMultiple\Form
20
 * @codeCoverageIgnore
21
 */
22 View Code Duplication
class Form extends Container
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
{
24
    /**
25
     * @return void
26
     * @SuppressWarnings(PHPMD.CamelCaseMethodName)
27
     */
28
    protected function _construct(): void
29
    {
30
        $this->_blockGroup = 'LizardMedia_VarnishWarmer';
31
        $this->_controller = 'adminhtml_purgeMultiple_form';
32
33
        parent::_construct();
34
35
        $this->updateSaveButton();
36
        $this->removeButtons();
37
    }
38
39
    /**
40
     * @return Phrase
41
     */
42
    public function getHeaderText(): Phrase
43
    {
44
        return __('Varnish: purge a group of URLs');
45
    }
46
47
    /**
48
     * @return void
49
     */
50
    private function updateSaveButton(): void
51
    {
52
        $this->buttonList->update(
53
            'save',
54
            'label',
55
            __('Run process')
56
        );
57
    }
58
59
    /**
60
     * @return void
61
     */
62
    private function removeButtons(): void
63
    {
64
        $this->buttonList->remove('delete');
65
        $this->buttonList->remove('back');
66
        $this->buttonList->remove('reset');
67
    }
68
}
69