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

CPS-IT / handlebars / 22660183928

04 Mar 2026 07:53AM UTC coverage: 90.285% (-8.8%) from 99.094%
22660183928

push

github

eliashaeussler
Merge branch '1.x'

1277 of 1418 new or added lines in 66 files covered. (90.06%)

2 existing lines in 1 file now uncovered.

1329 of 1472 relevant lines covered (90.29%)

6.92 hits per line

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

64.0
/Classes/Exception/InvalidHelperException.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the TYPO3 CMS extension "handlebars".
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17

18
namespace CPSIT\Typo3Handlebars\Exception;
19

20
/**
21
 * InvalidHelperException
22
 *
23
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
24
 * @license GPL-2.0-or-later
25
 */
26
final class InvalidHelperException extends \Exception
27
{
28
    public static function forFunction(string $helperFunction): self
1✔
29
    {
30
        return new self(
1✔
31
            \sprintf('The helper function "%s" is invalid.', $helperFunction),
1✔
32
            1637339290
1✔
33
        );
1✔
34
    }
35

36
    public static function forUnsupportedType(mixed $helperFunction): self
1✔
37
    {
38
        return new self(
1✔
39
            \sprintf('Only callables, strings and arrays can be defined as helpers, "%s" given.', \get_debug_type($helperFunction)),
1✔
40
            1637339694
1✔
41
        );
1✔
42
    }
43

44
    /**
45
     * @param array{class-string|object, string} $callable
46
     */
47
    public static function forInvalidCallable(array $callable): self
1✔
48
    {
49
        [$className, $methodName] = $callable;
1✔
50

51
        return new self(
1✔
52
            \sprintf('The helper function with callable [%s, %s] is not valid.', \get_debug_type($className), \get_debug_type($methodName)),
1✔
53
            1638180355
1✔
54
        );
1✔
55
    }
56

NEW
57
    public static function forUnresolvableParameter(callable $helperFunction, string $parameterName): self
×
58
    {
NEW
59
        return new self(
×
NEW
60
            \sprintf(
×
NEW
61
                'The helper function with callable %s requires an unresolvable parameter "$%s".',
×
NEW
62
                \get_debug_type($helperFunction),
×
NEW
63
                $parameterName,
×
NEW
64
            ),
×
NEW
65
            1767777282,
×
NEW
66
        );
×
67
    }
68
}
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