Skip to content

Commit c136d5b

Browse files
committed
bug #235 Fix invalid use of count() in PHP 7.2 (merk)
This PR was merged into the 3.x-dev branch. Discussion ---------- Fix invalid use of count() in PHP 7.2 ref #223 PHP 7.2+ issues a warning when trying to count a non Iterable. The case in this code is not clear if it should just check for the presence of a handler or not. I suspect the original intention was to make sure the specified handler is defined in the configuration, but this should happen in the Extension? Commits ------- ab76969 Fix invalid use of count() in PHP 7.2
2 parents 11f1246 + ab76969 commit c136d5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ public function getConfigTreeBuilder()
651651
->thenInvalid('Service handlers can not have a formatter configured in the bundle, you must reconfigure the service itself instead')
652652
->end()
653653
->validate()
654-
->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && 1 !== count($v['handler']); })
654+
->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && empty($v['handler']); })
655655
->thenInvalid('The handler has to be specified to use a FingersCrossedHandler or BufferHandler or FilterHandler')
656656
->end()
657657
->validate()

0 commit comments

Comments
 (0)