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

DoclerLabs / api-client-generator / 21433352645

28 Jan 2026 09:50AM UTC coverage: 86.69% (-0.3%) from 86.973%
21433352645

push

github

web-flow
Merge pull request #131 from DoclerLabs/dependabot/composer/phpunit/phpunit-9.6.33

Bump phpunit/phpunit from 9.5.9 to 9.6.33

3465 of 3997 relevant lines covered (86.69%)

7.11 hits per line

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

14.29
/src/Entity/Constraint/MinimumConstraint.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace DoclerLabs\ApiClientGenerator\Entity\Constraint;
6

7
use DoclerLabs\ApiClientGenerator\Ast\Builder\CodeBuilder;
8
use DoclerLabs\ApiClientGenerator\Entity\FieldType;
9
use PhpParser\Node\Expr;
10
use PhpParser\Node\Expr\Variable;
11

12
class MaximumConstraint implements ConstraintInterface
13
{
14
    public function __construct(private ?float $maximum, private bool|float|null $exclusiveMaximum, private FieldType $fieldType)
15
    {
16
        // openapi 3.1 exclusiveMaximum is no longer a boolean
17
        if (is_float($exclusiveMaximum)) {
3✔
18
            $this->maximum          = $exclusiveMaximum;
×
19
            $this->exclusiveMaximum = true;
×
20
        }
21
    }
22

23
    public function exists(): bool
24
    {
25
        return $this->maximum !== null;
2✔
26
    }
27

28
    public function getIfCondition(Variable $variable, CodeBuilder $builder): Expr
29
    {
30
        return $builder->compare(
×
31
            $variable,
×
32
            $this->exclusiveMaximum === true ? '>=' : '>',
×
33
            $builder->val($this->fieldType->isInteger() ? (int)$this->maximum : $this->maximum)
×
34
        );
×
35
    }
36

37
    public function getExceptionMessage(): string
38
    {
39
        return sprintf(
×
40
            'Cannot be greater than %s%s.',
×
41
            $this->exclusiveMaximum === true ? 'or equal to ' : '',
×
42
            $this->fieldType->isInteger() ? (int)$this->maximum : $this->maximum
×
43
        );
×
44
    }
45
}
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