Skip to content

Commit e97d6ba

Browse files
committed
Separate PHP 8.4 tests
1 parent 776032d commit e97d6ba

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

resources/functionMap_php84delta.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
'new' => [
1818
'http_get_last_response_header ' => ['list<string>'],
1919
'http_clear_last_response_header' => ['void'],
20+
'mb_lcfirst' => ['string', 'str'=>'string', 'encoding='=>'string'],
21+
'mb_ucfirst' => ['string', 'str'=>'string', 'encoding='=>'string'],
2022
],
2123
'old' => [
2224

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,9 @@ public function dataFileAsserts(): iterable
10821082
if (PHP_VERSION_ID >= 70300) {
10831083
yield from $this->gatherAssertTypes(__DIR__ . '/data/str-casing.php');
10841084
}
1085+
if (PHP_VERSION_ID >= 80400) {
1086+
yield from $this->gatherAssertTypes(__DIR__ . '/data/str-caseing-php84.php');
1087+
}
10851088
yield from $this->gatherAssertTypes(__DIR__ . '/data/non-empty-string-substr-specifying.php');
10861089
yield from $this->gatherAssertTypes(__DIR__ . '/data/unset-conditional-expressions.php');
10871090
yield from $this->gatherAssertTypes(__DIR__ . '/data/conditional-types-inference.php');
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace StrCasingReturnTypePhp84;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class Foo {
8+
/**
9+
* @param numeric-string $numericS
10+
* @param non-empty-string $nonE
11+
* @param literal-string $literal
12+
* @param 'foo'|'Foo' $edgeUnion
13+
*/
14+
public function bar($numericS, $nonE, $literal) {
15+
assertType("'aBC'", mb_lcfirst('ABC'));
16+
assertType("'Abc'", mb_ucfirst('abc'));
17+
assertType("numeric-string", mb_lcfirst($numericS));
18+
assertType("numeric-string", mb_ucfirst($numericS));
19+
assertType("non-empty-string", mb_lcfirst($nonE));
20+
assertType("non-empty-string", mb_ucfirst($nonE));
21+
assertType("string", mb_lcfirst($literal));
22+
assertType("string", mb_ucfirst($literal));
23+
}
24+
}

0 commit comments

Comments
 (0)