Skip to content

Commit 69e056c

Browse files
committed
Improve map
1 parent 74913da commit 69e056c

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

resources/constantToFunctionParameterMap.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,4 +2512,35 @@
25122512
],
25132513
],
25142514
],
2515+
2516+
// RecursiveIteratorIterator
2517+
2518+
'RecursiveIteratorIterator::__construct' => [
2519+
'mode' => [
2520+
'type' => 'single',
2521+
'constants' => [
2522+
'RecursiveIteratorIterator::LEAVES_ONLY',
2523+
'RecursiveIteratorIterator::SELF_FIRST',
2524+
'RecursiveIteratorIterator::CHILD_FIRST',
2525+
],
2526+
],
2527+
'flags' => [
2528+
'type' => 'bitmask',
2529+
'constants' => [
2530+
'RecursiveIteratorIterator::CATCH_GET_CHILD',
2531+
],
2532+
],
2533+
],
2534+
2535+
// DatePeriod
2536+
2537+
'DatePeriod::__construct' => [
2538+
'options' => [
2539+
'type' => 'bitmask',
2540+
'constants' => [
2541+
'DatePeriod::EXCLUDE_START_DATE',
2542+
'DatePeriod::INCLUDE_END_DATE',
2543+
],
2544+
],
2545+
],
25152546
];

tests/PHPStan/Rules/Classes/InstantiationRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ public function testBug9946(): void
456456
public function testBug10324(): void
457457
{
458458
$this->analyse([__DIR__ . '/data/bug-10324.php'], [
459+
[
460+
'Constant RecursiveIteratorIterator::CHILD_FIRST is not allowed for parameter #3 $flags of class RecursiveIteratorIterator constructor.',
461+
23,
462+
],
459463
[
460464
'Parameter #3 $flags of class RecursiveIteratorIterator constructor expects 0|16, 2 given.',
461465
23,

0 commit comments

Comments
 (0)