Skip to content

Commit

Permalink
fix issue #109 - need to update references after this fix
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Jan 19, 2022
1 parent 02a1bff commit 52a15e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG-3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ using the [Keep a CHANGELOG](http://keepachangelog.com) principles.
- drop support of Doctrine DBAL v2, and raise minimum constraint to 3.2 to satisfy [Deprecated `AbstractPlatform::getName()](https://github.com/doctrine/dbal/commit/4b174ad06ec74d7678251dcacbf43977ae762554)
- drop support of `composer/semver` v1 and v2

### Fixed

- [#109](https://github.com/llaville/php-compatinfo-db/issues/109) Class constants not well detected

## [3.17.0] - 2022-01-05

### Changed
Expand Down
11 changes: 4 additions & 7 deletions tests/Reference/GenericTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ private function classConstantsFromExtensionProvider(): Generator
{
$extension = $this->getReflectionExtension();
$classes = array_unique($extension->getClassNames());
$elements = [];

foreach ($classes as $classname) {
try {
Expand All @@ -406,17 +405,15 @@ private function classConstantsFromExtensionProvider(): Generator
/* Skip class alias */
continue;
}

$elements = $elements + array_map(
$elements = array_map(
function ($value) use ($classname) {
return "$classname::$value";
},
array_keys($class->getConstants())
);
}

foreach ($elements as $name) {
yield $name;
foreach ($elements as $name) {
yield $name;
}
}
}

Expand Down

0 comments on commit 52a15e8

Please sign in to comment.