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

CPS-IT / handlebars / 26435784990

26 May 2026 06:17AM UTC coverage: 89.827% (-0.02%) from 89.851%
26435784990

push

github

web-flow
Merge pull request #580 from CPS-IT/fix/join

[BUGFIX] Loosen type for join parts in `join` helper

7 of 8 new or added lines in 1 file covered. (87.5%)

1457 of 1622 relevant lines covered (89.83%)

7.19 hits per line

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

87.5
/Classes/Renderer/Helper/JoinHelper.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\Renderer\Helper;
19

20
use CPSIT\Typo3Handlebars\Attribute;
21
use DevTheorem\Handlebars;
22

23
/**
24
 * JoinHelper
25
 *
26
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
27
 * @license GPL-2.0-or-later
28
 */
29
#[Attribute\AsHelper('join')]
30
final readonly class JoinHelper implements Helper
31
{
32
    public function render(Handlebars\HelperOptions $options, mixed ...$parts): string
2✔
33
    {
34
        return implode('', array_map($this->convertToString(...), $parts));
2✔
35
    }
36

37
    private function convertToString(mixed $value): ?string
2✔
38
    {
39
        if (is_scalar($value)) {
2✔
40
            return (string)$value;
2✔
41
        }
42

43
        if ($value instanceof \Stringable) {
2✔
44
            return (string)$value;
2✔
45
        }
46

NEW
47
        return null;
×
48
    }
49
}
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