Source: php-zeta-console-tools Version: 1.7.3-1 Severity: normal Tags: patch X-Debbugs-Cc: athos.ribe...@canonical.com
Dear Maintainer, The package currently FTBFS with PHP 8.3 (in experimental). This happens because, when incrementing booleans (which is a noop in PHP8 < 8.4), PHP 8.3 emits a E_WARNING, leading to a phpunit test failure. This has been reported upstream in https://github.com/zetacomponents/ConsoleTools/pull/25 I am also attaching a patch which should fix this.
Description: Do not increment boolean variables Before php8.3, incrementing/decrementing boolean variables have no effect. In php8.3, an E_WARNING is emitted to let users know about the lack of effect of the operation, which may cause test suite failures. Starting in php8.4, those operations will have a new effect over the variable. Let's avoid these output changes by not performing inc/dec operations over booleans. For further reference, please see https://wiki.php.net/rfc/saner-inc-dec-operators. Author: Athos Ribeiro <athos.ribe...@canonical.com> Forwarded: https://github.com/zetacomponents/ConsoleTools/pull/25 Last-Update: 2024-01-25 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/src/input/help_generators/standard.php +++ b/src/input/help_generators/standard.php @@ -318,7 +318,7 @@ $synopsis = ''; // Break after a nesting level of 2 - if ( $depth++ > 2 || ( in_array( $option->short, $usedOptions['short'] ) && in_array( $option->long, $usedOptions['long'] ) ) ) return $synopsis; + if ( (!is_bool($depth) && $depth++ > 2) || ( in_array( $option->short, $usedOptions['short'] ) && in_array( $option->long, $usedOptions['long'] ) ) ) return $synopsis; $usedOptions['short'][] = $option->short; $usedOptions['long'][] = $option->long;