Skip to content

Commit 679f531

Browse files
Firehedclaude
authored andcommitted
Add test for GMP increment/decrement operations
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a8e2d31 commit 679f531

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

tests/PHPStan/Rules/Operators/InvalidIncDecOperationRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,9 @@ public function testBcMathNumber(): void
249249
$this->analyse([__DIR__ . '/data/inc-dec-bcmath-number.php'], []);
250250
}
251251

252+
public function testGmp(): void
253+
{
254+
$this->analyse([__DIR__ . '/data/inc-dec-gmp.php'], []);
255+
}
256+
252257
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace IncDecGmp;
4+
5+
use GMP;
6+
7+
function testPreInc(GMP $x): void {
8+
++$x;
9+
}
10+
11+
function testPostInc(GMP $x): void {
12+
$x++;
13+
}
14+
15+
function testPreDec(GMP $x): void {
16+
--$x;
17+
}
18+
19+
function testPostDec(GMP $x): void {
20+
$x--;
21+
}

0 commit comments

Comments
 (0)