Skip to content

Commit 2e26fab

Browse files
Merge branch 'main' into dropphp81
2 parents 8cb024a + 75a1d63 commit 2e26fab

File tree

25 files changed

+338
-17
lines changed

25 files changed

+338
-17
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.6.0"
2+
".": "3.6.1"
33
}

.github/workflows/release-please.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
name: Create new release PR
1919
steps:
20-
- uses: googleapis/release-please-action@c2a5a2bd6a758a0937f1ddb1e8950609867ed15c # v4
20+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4
2121
with:
2222
token: ${{ secrets.GITHUB_TOKEN }}
2323
config-file: .github/actions/release-please/config.json

.github/workflows/sloth.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: lendable/sloth@1d0ce54a04a834366b4af63362ffd0a58fc447ad # 0.2.2
3535
with:
3636
token: ${{ secrets.GITHUB_TOKEN }}
37-
interval: 10
37+
interval: 15
3838
ignored: |
3939
CodeRabbit
4040
Scrutinizer

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [3.6.1](https://github.com/martin-georgiev/postgresql-for-doctrine/compare/v3.6.0...v3.6.1) (2025-11-08)
4+
5+
6+
### Bug Fixes
7+
8+
* **#473:** Add public getter methods to `Range` value objects ([#477](https://github.com/martin-georgiev/postgresql-for-doctrine/issues/477)) ([9ba319e](https://github.com/martin-georgiev/postgresql-for-doctrine/commit/9ba319ea1d4cfeea48dfa6ab44d1820f51c689a9))
9+
* **#474:** Support usage of arithmetic expressions in mathematical functions ([#475](https://github.com/martin-georgiev/postgresql-for-doctrine/issues/475)) ([75b025d](https://github.com/martin-georgiev/postgresql-for-doctrine/commit/75b025d636b52621b4be47bd94ea1f163017450e))
10+
311
## [3.6.0](https://github.com/martin-georgiev/postgresql-for-doctrine/compare/v3.5.1...v3.6.0) (2025-10-23)
412

513

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
"deptrac/deptrac": "^4.0",
4848
"doctrine/orm": "~2.14||~3.0",
4949
"ekino/phpstan-banned-code": "^3.0",
50-
"friendsofphp/php-cs-fixer": "^3.88.2",
50+
"friendsofphp/php-cs-fixer": "^3.89.2",
5151
"phpstan/phpstan": "^2.1.31",
5252
"phpstan/phpstan-deprecation-rules": "^2.0.3",
53-
"phpstan/phpstan-doctrine": "^2.0.10",
53+
"phpstan/phpstan-doctrine": "^2.0.11",
5454
"phpstan/phpstan-phpunit": "^2.0.7",
5555
"phpunit/phpunit": "^10.5.58",
56-
"rector/rector": "^2.2.3",
56+
"rector/rector": "^2.2.7",
5757
"symfony/cache": "^6.4||^7.0"
5858
},
5959
"suggest": {

src/MartinGeorgiev/Doctrine/DBAL/Types/ValueObject/Range.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ abstract class Range implements \Stringable
2323

2424
protected const EMPTY_RANGE_STRING = 'empty';
2525

26+
/**
27+
* @param R|null $lower
28+
* @param R|null $upper
29+
*/
2630
public function __construct(
2731
protected readonly mixed $lower,
2832
protected readonly mixed $upper,
@@ -140,4 +144,29 @@ public static function infinite(): static
140144
{
141145
return new static(null, null, false, false);
142146
}
147+
148+
public function getLower(): \DateTimeInterface|float|int|null
149+
{
150+
return $this->lower;
151+
}
152+
153+
public function getUpper(): \DateTimeInterface|float|int|null
154+
{
155+
return $this->upper;
156+
}
157+
158+
public function isLowerBracketInclusive(): bool
159+
{
160+
return $this->isLowerBracketInclusive;
161+
}
162+
163+
public function isUpperBracketInclusive(): bool
164+
{
165+
return $this->isUpperBracketInclusive;
166+
}
167+
168+
public function isExplicitlyEmpty(): bool
169+
{
170+
return $this->isExplicitlyEmpty;
171+
}
143172
}

src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseArithmeticFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ abstract class BaseArithmeticFunction extends BaseVariadicFunction
1313
{
1414
protected function getNodeMappingPattern(): array
1515
{
16-
return ['ArithmeticPrimary'];
16+
return ['SimpleArithmeticExpression'];
1717
}
1818

1919
protected function getMinArgumentCount(): int

src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Gamma.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class Gamma extends BaseFunction
1717
protected function customizeFunction(): void
1818
{
1919
$this->setFunctionPrototype('gamma(%s)');
20-
$this->addNodeMapping('ArithmeticPrimary');
20+
$this->addNodeMapping('SimpleArithmeticExpression');
2121
}
2222
}

src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Lgamma.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class Lgamma extends BaseFunction
1717
protected function customizeFunction(): void
1818
{
1919
$this->setFunctionPrototype('lgamma(%s)');
20-
$this->addNodeMapping('ArithmeticPrimary');
20+
$this->addNodeMapping('SimpleArithmeticExpression');
2121
}
2222
}

tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,20 @@ public function can_calculate_cube_root_of_negative_number(): void
4949
#[Test]
5050
public function can_calculate_cube_root_of_column_value(): void
5151
{
52-
$dql = 'SELECT CBRT(n.decimal1) as result
53-
FROM Fixtures\MartinGeorgiev\Doctrine\Entity\ContainsNumerics n
52+
$dql = 'SELECT CBRT(n.decimal1) as result
53+
FROM Fixtures\MartinGeorgiev\Doctrine\Entity\ContainsNumerics n
5454
WHERE n.id = 1';
5555
$result = $this->executeDqlQuery($dql);
5656
$this->assertEqualsWithDelta(2.1897595699439445, $result[0]['result'], 0.0001);
5757
}
58+
59+
#[Test]
60+
public function can_calculate_cube_root_of_arithmetic_expression(): void
61+
{
62+
$dql = 'SELECT CBRT(n.integer1 + n.integer2 - 3) as result
63+
FROM Fixtures\MartinGeorgiev\Doctrine\Entity\ContainsNumerics n
64+
WHERE n.id = 1';
65+
$result = $this->executeDqlQuery($dql);
66+
$this->assertEqualsWithDelta(3.0, $result[0]['result'], 0.0001);
67+
}
5868
}

0 commit comments

Comments
 (0)