Skip to content

Commit

Permalink
Test for crash (php-8-stubs mentioning enum in functions map)
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 9, 2025
1 parent 85a895e commit ad610cf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/PHPStan/Analyser/AnalyserIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,12 @@ public function testBug11913(): void
$this->assertNoErrors($errors);
}

public function testBug12549(): void
{
$errors = $this->runAnalyse(__DIR__ . '/data/bug-12549.php');
$this->assertNoErrors($errors);
}

/**
* @param string[]|null $allAnalysedFiles
* @return Error[]
Expand Down
17 changes: 17 additions & 0 deletions tests/PHPStan/Analyser/data/bug-12549.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Bug12549;

class Foo
{
public const string OPTION_ROUNDING_MODE = 'roundingMode';

public function setRoundingMode(): void
{
$this->bar(self::OPTION_ROUNDING_MODE);
}

private function bar(string $v): void
{
}
}

0 comments on commit ad610cf

Please sign in to comment.