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

FluidTYPO3 / vhs / 30001290505

23 Jul 2026 10:57AM UTC coverage: 70.309% (-1.7%) from 72.022%
30001290505

push

github

NamelessCoder
[TER] 8.0.0

4819 of 6854 relevant lines covered (70.31%)

6.54 hits per line

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

66.67
/Classes/ViewHelpers/Math/MinimumViewHelper.php
1
<?php
2
namespace FluidTYPO3\Vhs\ViewHelpers\Math;
3

4
/*
5
 * This file is part of the FluidTYPO3/Vhs 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 FluidTYPO3\Vhs\Traits\ArgumentOverride;
12
use FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait;
13
use FluidTYPO3\Vhs\Utility\ErrorUtility;
14

15
/**
16
 * Math: Minimum
17
 *
18
 * Gets the lowest number in array $a or the lowest
19
 * number of numbers $a and $b.
20
 */
21
class MinimumViewHelper extends AbstractMultipleMathViewHelper
22
{
23
    use ArrayConsumingViewHelperTrait;
24
    use ArgumentOverride;
25

26
    public function initializeArguments(): void
27
    {
28
        parent::initializeArguments();
3✔
29
        $this->overrideArgument('b', 'mixed', 'Second number or Iterator/Traversable/Array for calculation');
3✔
30
    }
31

32
    /**
33
     * @param mixed $a
34
     * @param mixed $b
35
     * @return mixed
36
     */
37
    protected static function calculateAction($a, $b, array $arguments)
38
    {
39
        $aIsIterable = static::assertIsArrayOrIterator($a);
3✔
40
        if (!$aIsIterable && $b === null && $arguments['fail']) {
3✔
41
            ErrorUtility::throwViewHelperException('Required argument "b" was not supplied', 1237823699);
×
42
        }
43
        if ($aIsIterable && null === $b) {
3✔
44
            $a = static::arrayFromArrayOrTraversableOrCSVStatic($a);
×
45
            return min($a);
×
46
        }
47
        return min($a, $b);
3✔
48
    }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc