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

heimrichhannot / contao-utils-bundle / 9254340622

27 May 2024 11:53AM UTC coverage: 23.388% (-0.2%) from 23.563%
9254340622

push

github

ericges
backport static utils

0 of 42 new or added lines in 3 files covered. (0.0%)

1320 of 5644 relevant lines covered (23.39%)

1.56 hits per line

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

0.0
/src/StaticUtil/SUtils.php
1
<?php
2

3
namespace HeimrichHannot\UtilsBundle\StaticUtil;
4

5
class SUtils
6
{
7
    protected static array $instances = [];
8

9
    public static function array(): StaticArrayUtil
10
    {
NEW
11
        return static::getInstance(StaticArrayUtil::class);
×
12
    }
13

14
    public static function class(): StaticClassUtil
15
    {
NEW
16
        return static::getInstance(StaticClassUtil::class);
×
17
    }
18

19
    /**
20
     * @template T
21
     * @param class-string<T> $class
22
     * @return T The instance of the given class.
23
     */
24
    protected static function getInstance(string $class): object
25
    {
NEW
26
        if (!isset(static::$instances[$class])) {
×
NEW
27
            static::$instances[$class] = new $class;
×
28
        }
29

NEW
30
        return static::$instances[$class];
×
31
    }
32
}
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