Skip to content

Commit d9c6377

Browse files
authored
Added regression test
1 parent 6023a81 commit d9c6377

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,9 @@ public function testNoNamespace(): void
7676
]);
7777
}
7878

79+
public function testBug13210(): void
80+
{
81+
$this->analyse([__DIR__ . '/data/bug-13210.php'], []);
82+
}
83+
7984
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/**
4+
* @internal
5+
*
6+
* @readonly
7+
*/
8+
final class DBInternal
9+
{
10+
public static function phpValueToSql(int|string|BackedEnum|null $phpValue): string
11+
{
12+
return match (true) {
13+
$phpValue === null => 'NULL',
14+
is_string($phpValue) => "''",
15+
is_int($phpValue) => (string)$phpValue,
16+
$phpValue instanceof BackedEnum => self::phpValueToSql($phpValue->value),
17+
};
18+
}
19+
20+
}

0 commit comments

Comments
 (0)