bug #31999 [PhpunitBridge] Restore php 5.5 compat (greg0ire)
This PR was merged into the 4.3 branch.
Discussion
----------
[PhpunitBridge] Restore php 5.5 compat
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
The `ARRAY_FILTER_USE_KEY` constant was introduced in php 5.6, let us
avoid it for now.
See https://www.php.net/manual/en/function.array-filter.php#refsect1-function.array-filter-changelog
Thanks @alcaeus for spotting this in https://travis-ci.org/doctrine/DoctrineBundle/jobs/543340482#L596
Commits
-------
496c118c3a
Restore compatibility with php 5.5
This commit is contained in:
commit
c45c6e50e1
@ -90,9 +90,12 @@ class Configuration
|
|||||||
*/
|
*/
|
||||||
public function tolerates(array $deprecations)
|
public function tolerates(array $deprecations)
|
||||||
{
|
{
|
||||||
$deprecationCounts = array_filter($deprecations, function ($key) {
|
$deprecationCounts = [];
|
||||||
return false !== strpos($key, 'Count') && false === strpos($key, 'legacy');
|
foreach ($deprecations as $key => $deprecation) {
|
||||||
}, ARRAY_FILTER_USE_KEY);
|
if (false !== strpos($key, 'Count') && false === strpos($key, 'legacy')) {
|
||||||
|
$deprecationCounts[$key] = $deprecation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (array_sum($deprecationCounts) > $this->thresholds['total']) {
|
if (array_sum($deprecationCounts) > $this->thresholds['total']) {
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user