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

FluidTYPO3 / flux / 27757675993

18 Jun 2026 11:55AM UTC coverage: 89.162% (-3.5%) from 92.646%
27757675993

push

github

NamelessCoder
[TASK] Address last phpstan warnings

6228 of 6985 relevant lines covered (89.16%)

40.84 hits per line

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

97.14
/Classes/Utility/ExtensionNamingUtility.php
1
<?php
2
namespace FluidTYPO3\Flux\Utility;
3

4
/*
5
 * This file is part of the FluidTYPO3/Flux 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\GeneralUtility;
12

13
class ExtensionNamingUtility
14
{
15
    public static function hasVendorName(string $qualifiedExtensionName): bool
16
    {
17
        return false !== strpos($qualifiedExtensionName, '.');
108✔
18
    }
19

20
    public static function getVendorName(string $qualifiedExtensionName): ?string
21
    {
22
        [$vendorName, ] = static::getVendorNameAndExtensionKey($qualifiedExtensionName);
20✔
23
        return $vendorName;
20✔
24
    }
25

26
    public static function getExtensionKey(string $qualifiedExtensionName): string
27
    {
28
        [, $extensionKey] = static::getVendorNameAndExtensionKey($qualifiedExtensionName);
960✔
29
        return $extensionKey;
960✔
30
    }
31

32
    public static function getExtensionName(string $qualifiedExtensionName): string
33
    {
34
        [, $extensionName] = static::getVendorNameAndExtensionName($qualifiedExtensionName);
60✔
35
        return (string) $extensionName;
60✔
36
    }
37

38
    public static function getExtensionSignature(string $qualifiedExtensionName): string
39
    {
40
        static $cache = [];
8✔
41
        if (isset($cache[$qualifiedExtensionName])) {
8✔
42
            return $cache[$qualifiedExtensionName];
×
43
        }
44
        $extensionKey = static::getExtensionKey($qualifiedExtensionName);
8✔
45
        $cache[$qualifiedExtensionName] = str_replace('_', '', $extensionKey);
8✔
46
        return $cache[$qualifiedExtensionName];
8✔
47
    }
48

49
    public static function getVendorNameAndExtensionKey(string $qualifiedExtensionName): array
50
    {
51
        static $cache = [];
988✔
52
        if (isset($cache[$qualifiedExtensionName])) {
988✔
53
            return $cache[$qualifiedExtensionName];
964✔
54
        }
55
        if (true === static::hasVendorName($qualifiedExtensionName)) {
32✔
56
            [$vendorName, $extensionKey] = GeneralUtility::trimExplode('.', $qualifiedExtensionName);
12✔
57
        } else {
58
            $vendorName = null;
20✔
59
            $extensionKey = $qualifiedExtensionName;
20✔
60
        }
61
        $extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($extensionKey);
32✔
62
        $cache[$qualifiedExtensionName] = [$vendorName, $extensionKey];
32✔
63
        return [$vendorName, $extensionKey];
32✔
64
    }
65

66
    public static function getVendorNameAndExtensionName(string $qualifiedExtensionName): array
67
    {
68
        static $cache = [];
148✔
69
        if (isset($cache[$qualifiedExtensionName])) {
148✔
70
            return $cache[$qualifiedExtensionName];
96✔
71
        }
72
        if (true === static::hasVendorName($qualifiedExtensionName)) {
52✔
73
            [$vendorName, $extensionName] = GeneralUtility::trimExplode('.', $qualifiedExtensionName);
20✔
74
        } else {
75
            $vendorName = null;
32✔
76
            $extensionName = $qualifiedExtensionName;
32✔
77
        }
78
        if (false !== strpos($extensionName, '_')) {
52✔
79
            $extensionName = GeneralUtility::underscoredToUpperCamelCase($extensionName);
12✔
80
        } else {
81
            $extensionName = ucfirst($extensionName);
40✔
82
        }
83
        $cache[$qualifiedExtensionName] = [$vendorName, $extensionName];
52✔
84
        return [$vendorName, $extensionName];
52✔
85
    }
86
}
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