• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

heimrichhannot / contao-utils-bundle / 11856428615

15 Nov 2024 12:39PM UTC coverage: 23.983% (+0.7%) from 23.297%
11856428615

Pull #86

github

koertho
enhance test coverage
Pull Request #86: Backend UI Util

53 of 59 new or added lines in 3 files covered. (89.83%)

1373 of 5725 relevant lines covered (23.98%)

1.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

68.42
/src/Util/Ui/PopupWizardLinkOptions.php
1
<?php
2

3
namespace HeimrichHannot\UtilsBundle\Util\Ui;
4

5
class PopupWizardLinkOptions
6
{
7
    /** @var string The route to generate the link */
8
    public string $route = 'contao_backend';
9
    /** @var bool If only the url should be returned instead of a complete link element */
10
    public bool $urlOnly = false;
11
    /** @var string The title of the link */
12
    public string $title = '';
13
    /** @var string Override the default css style properties */
14
    public string $style = 'padding-left: 5px; padding-top: 2px; display: inline-block;';
15
    /**  *@var array Additional Link attributes as key value pairs. Will override title and style option. href is not allowed and will be removed from list. */
16
    public array $attributes = [];
17
    /** @var string Link icon to show as link text. Overrides default icon. */
18
    public string $icon = 'alias.svg';
19
    /** @var string A linkTitle to show as link text. Will be displayed after the link icon. Default empty. */
20
    public string $linkText = '';
21
    /** @var int The width of the popup */
22
    public int $width = 991;
23
    /** @var string The title of the popup */
24
    public string $popupTitle = '';
25

26
    public function __construct()
27
    {
28
    }
3✔
29

30
    /**
31
     * Set the route to generate the link.
32
     */
33
    public function setRoute(string $route): PopupWizardLinkOptions
34
    {
NEW
35
        $this->route = $route;
×
NEW
36
        return $this;
×
37
    }
38

39
    /**
40
     * If only the url should be returned instead of a complete link element.
41
     */
42
    public function setUrlOnly(bool $urlOnly): PopupWizardLinkOptions
43
    {
44
        $this->urlOnly = $urlOnly;
1✔
45
        return $this;
1✔
46
    }
47

48
    /**
49
     * Set the title of the link.
50
     */
51
    public function setTitle(string $title): PopupWizardLinkOptions
52
    {
53
        $this->title = $title;
1✔
54
        return $this;
1✔
55
    }
56

57
    /**
58
     * Override the default css style properties.
59
     */
60
    public function setStyle(string $style): PopupWizardLinkOptions
61
    {
62
        $this->style = $style;
1✔
63
        return $this;
1✔
64
    }
65

66
    /**
67
     * Set additional link attributes as key value pairs. Will override title and style option. href and onclick are not allowed and will be removed from list.
68
     */
69
    public function setAttributes(array $attributes): PopupWizardLinkOptions
70
    {
NEW
71
        $this->attributes = $attributes;
×
NEW
72
        return $this;
×
73
    }
74

75
    /**
76
     * Add an additional attribute to the link.
77
     */
78
    public function setIcon(string $icon): PopupWizardLinkOptions
79
    {
NEW
80
        $this->icon = $icon;
×
NEW
81
        return $this;
×
82
    }
83

84
    /**
85
     * Override the default link text. Will be displayed after the link icon.
86
     */
87
    public function setLinkText(string $linkText): PopupWizardLinkOptions
88
    {
89
        $this->linkText = $linkText;
1✔
90
        return $this;
1✔
91
    }
92

93
    /**
94
     * Set the title of the popup.
95
     */
96
    public function setPopupTitle(string $string): PopupWizardLinkOptions
97
    {
98
        $this->popupTitle = $string;
1✔
99
        return $this;
1✔
100
    }
101

102
    /**
103
     * Set the width of the popup.
104
     */
105
    public function setWidth(int $width): PopupWizardLinkOptions
106
    {
107
        $this->width = $width;
1✔
108
        return $this;
1✔
109
    }
110
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc