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

CPS-IT / handlebars / 23361170525

20 Mar 2026 08:24PM UTC coverage: 90.027% (-0.3%) from 90.285%
23361170525

Pull #543

github

web-flow
Merge da28b186c into 86597a598
Pull Request #543: [TASK] Update codebase to match PHPStan level 9

127 of 142 new or added lines in 41 files covered. (89.44%)

7 existing lines in 4 files now uncovered.

1354 of 1504 relevant lines covered (90.03%)

6.84 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

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