Skip to content

Commit ae9d277

Browse files
schlndhondrejmirtes
authored andcommitted
make BcMath\Number::$value numeric-string
1 parent 38712dd commit ae9d277

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\PhpDoc;
4+
5+
use PHPStan\DependencyInjection\AutowiredService;
6+
use PHPStan\Php\PhpVersion;
7+
8+
#[AutowiredService]
9+
final class BcMathNumberStubFilesExtension implements StubFilesExtension
10+
{
11+
12+
public function __construct(private PhpVersion $phpVersion)
13+
{
14+
}
15+
16+
public function getFiles(): array
17+
{
18+
if (!$this->phpVersion->supportsBcMathNumberOperatorOverloading()) {
19+
return [];
20+
}
21+
22+
return [__DIR__ . '/../../stubs/bcmath.stub'];
23+
}
24+
25+
}

stubs/bcmath.stub

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace BcMath;
4+
5+
class Number {
6+
/** @var numeric-string */
7+
public readonly string $value;
8+
}

0 commit comments

Comments
 (0)