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

FluidTYPO3 / vhs / 12975041611

26 Jan 2025 01:20PM UTC coverage: 72.19% (-0.08%) from 72.266%
12975041611

Pull #1926

github

web-flow
Merge 046032fb2 into 5b3ef9980
Pull Request #1926: [FEATURE] Add compatibility layer to basically all ViewHelpers

71 of 106 new or added lines in 6 files covered. (66.98%)

5620 of 7785 relevant lines covered (72.19%)

17.26 hits per line

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

86.96
/Classes/Traits/TagViewHelperCompatibility.php
1
<?php
2
namespace FluidTYPO3\Vhs\Traits;
3

4
/*
5
 * This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE.md file that was distributed with this source code.
9
 */
10

11
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
12

13
trait TagViewHelperCompatibility
14
{
15
    /**
16
     * Register a new tag attribute. Tag attributes are all arguments which will be directly appended to a tag if you
17
     * call $this->initializeTag()
18
     *
19
     * @param string $name Name of tag attribute
20
     * @param string $type Type of the tag attribute
21
     * @param string $description Description of tag attribute
22
     * @param bool $required set to true if tag attribute is required. Defaults to false.
23
     * @param mixed $defaultValue Optional, default value of attribute if one applies
24
     * @return void
25
     * @api
26
     */
27
    protected function registerTagAttribute($name, $type, $description, $required = false, $defaultValue = null)
28
    {
29
        if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '13.4', '>=')) {
84✔
NEW
30
            $this->registerArgument($name, $type, $description, $required, $defaultValue);
×
NEW
31
            return;
×
32
        }
33
        parent::registerTagAttribute($name, $type, $description, $required, $defaultValue);
84✔
34
    }
35

36
    /**
37
     * Registers all standard HTML universal attributes.
38
     * Should be used inside registerArguments();
39
     *
40
     * @return void
41
     * @api
42
     */
43
    protected function registerUniversalTagAttributes()
44
    {
45
        if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '13.4', '>=')) {
72✔
NEW
46
            return;
×
47
        }
48
        $this->registerTagAttribute('class', 'string', 'CSS class(es) for this element');
72✔
49
        $this->registerTagAttribute(
72✔
50
            'dir',
72✔
51
            'string',
72✔
52
            'Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)'
72✔
53
        );
72✔
54
        $this->registerTagAttribute('id', 'string', 'Unique (in this file) identifier for this HTML element.');
72✔
55
        $this->registerTagAttribute(
72✔
56
            'lang',
72✔
57
            'string',
72✔
58
            'Language for this element. Use short names specified in RFC 1766'
72✔
59
        );
72✔
60
        $this->registerTagAttribute('style', 'string', 'Individual CSS styles for this element');
72✔
61
        $this->registerTagAttribute('title', 'string', 'Tooltip text of element');
72✔
62
        $this->registerTagAttribute('accesskey', 'string', 'Keyboard shortcut to access this element');
72✔
63
        $this->registerTagAttribute('tabindex', 'integer', 'Specifies the tab order of this element');
72✔
64
        $this->registerTagAttribute('onclick', 'string', 'JavaScript evaluated for the onclick event');
72✔
65
    }
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc