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

nextras / orm / 13354993605

16 Feb 2025 12:29PM UTC coverage: 91.73% (-0.3%) from 92.021%
13354993605

push

github

web-flow
Merge pull request #732 from nextras/datetime-property-wrapper

Datetime property wrapper

94 of 112 new or added lines in 15 files covered. (83.93%)

1 existing line in 1 file now uncovered.

4115 of 4486 relevant lines covered (91.73%)

4.57 hits per line

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

83.33
/src/Collection/Functions/CompareSmallerThanEqualsFunction.php
1
<?php declare(strict_types = 1);
2

3
namespace Nextras\Orm\Collection\Functions;
4

5

6
use Nextras\Orm\Collection\Functions\Result\DbalExpressionResult;
7
use Nextras\Orm\Entity\PropertyComparator;
8
use Nextras\Orm\Exception\InvalidArgumentException;
9
use function is_array;
10

11

12
class CompareSmallerThanEqualsFunction extends BaseCompareFunction
13
{
14
        protected function evaluateInPhp(mixed $sourceValue, mixed $targetValue, PropertyComparator|null $comparator): bool
15
        {
16
                if ($comparator === null) {
5✔
17
                        return $sourceValue <= $targetValue;
5✔
18
                } else {
NEW
19
                        return $comparator->compare($sourceValue, $targetValue) <= 0;
×
20
                }
21
        }
22

23

24
        protected function evaluateInDb(
25
                DbalExpressionResult $expression,
26
                mixed $value,
27
                string|array|null $modifier,
28
        ): DbalExpressionResult
29
        {
30
                if (is_array($modifier)) throw new InvalidArgumentException();
5✔
31
                $modifier = $modifier ?? '%any';
5✔
32
                return $expression->append("<= $modifier", $value);
5✔
33
        }
34
}
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