Releases: julien-boudry/Condorcet
Version 5.0.7
Description
Bug fix and maintenance release with type annotation improvements.
Fixed
- Restored
brick/mathversion constraint to allow both^0.14and^0.15(regression introduced in v5.0.5).
Version 5.0.6
Description
Maintenance release focused on static-analysis quality and method metadata consistency.
Added
- Added explicit
IS_INFORMATIONALmetadata support to better expose informational-only algorithms.
Changed
- Marked
Smith setandSchwartz setas informational methods (IS_INFORMATIONAL = true). - Extended test coverage to assert
IS_INFORMATIONALacross the full authorized method list, ensuring onlySmith setandSchwartz setare informational. - Updated PHPDoc type annotations (including return types) to improve PHPStan and static analysis quality.
- Vote and candidate removal methods now maintain original array keys in the returned array.
Version 5.0.5
Description
Maintenance release with dependency updates.
Changed
- Updated
brick/mathdependency to^0.15. - Updated
pestphp/pestdev dependency to^4.4. - Updated
friendsofphp/php-cs-fixerdev dependency to^3.94.
Version 5.0.4
Description
Bug fix release for the timer subsystem.
Fixed
- Timer — silent tracking gaps:
Timer\Chronoinstances created without being
assigned to a variable were immediately destroyed (PHP destructor fires at
end-of-statement), recording ~0 ms instead of the actual operation time. Affected
operations:Pairwise::doPairwise(),Pairwise::addNewVote(),
Pairwise::removeVote(), and theCondorcetBasicbranch ofgetWinner()/
getLoser(). As a result,getGlobalTimer()was underreporting total computation
time andgetTimerManager()->getHistory()was missing entries.
Changed
- Timer\Manager — wall-clock model:
addTime()now always records every chrono
in history regardless of nesting.globalTimeris recalculated as
last_end − startDeclare(wall-clock of the full computation window) instead of
being a running sum, eliminating double-counting when chronos are nested (e.g.
GetResultwrappingGetWinner/GetLosertriggered byResult::__construct).
Internal changes
Timer\Manager::$historyandgetHistory()are now fully typed with a PHPDoc
array shape:list<array{role: ?string, process_in: float, timer_start: float, timer_end: float}>.- Added comprehensive tests for
Timer\Manager::getHistory().
Version 5.0.3
Description
Maintenance release with Symfony 8 support and dependency updates.
Changed
- Added support for Symfony 8.0 components, now requiring Symfony 7.4 minimum.
- Updated friendsofphp/php-cs-fixer dependency to ^3.91.
Internal changes
- Removed unnecessary PHPStan ignore comments in Pairwise class.
Version 5.0.2
Description
Maintenance release with dependency updates and CI improvements.
Changed
- Reverted brick/math dependency to stable version ^0.14.1 for better compatibility.
Version 5.0.1
Description
Maintenance release with bug fixes, PHP 8.5 support, and documentation improvements.
Added
- Support for PHP 8.5.
- PHPDoc descriptions to all classes for better IDE support.
- API and internal annotations to interfaces for better documentation.
Changed
- Schwartz Set method: Improved and fixed algorithm implementation regarding ties and cycles. No longer marked as experimental.
- Smith Set method: Fixed algorithm implementation regarding ties and cycles. No longer marked as experimental.
- CPO-STV method: Renamed stats key
Candidates eliminated from first roundtoCandidates remaining after first roundfor clarity. - Improved console completion implementation.
- Symfony components 7.3 minimum are now required as it is the only version supported by Symfony.
Fixed
- Fixed PHP 8.5 deprecations related to null offset access.
- Fixed PHPDoc references to include full namespaces for better IDE support across multiple classes.
- Fixed CPO-STV method: Corrected a bug in the tie-breaker comparison for the final ranking.
- Fixed CPO-STV method: Corrected the coefficient calculation for vote weights in the internal pairwise comparison.
- Enabled
failOnWarning,failOnDeprecation, andfailOnNoticein PHPUnit configuration for stricter testing. - Added
skipOnWindowsto PHP preset to address Pest compatibility issues on Windows.
Internal changes
- Updated candidate name increment logic to use native
str_increment()function. - Use first-class callable syntax where applicable.
Dev
- Migrated from Laravel Pint to the original PHP CS Fixer for code style management.
- Updated dependencies in composer.json for compatibility and improvements.
- Updated PHPStan, Rector, PHP CS Fixer, and Pest versions.
- Updated macOS version in GitHub workflow to latest stable release.
- Updated PHP version to 8.5 in workflow files.
- Added
--prefer-loweststability testing to CI matrix (Ubuntu only) to ensure compatibility with minimum supported dependency versions. - Various linter improvements and fixes.
Version 5.0.0
Description
Major release with many breaking changes, a modernized API, removal of deprecated features, and significant optimizations.
To upgrade, it is recommended to test carefully and read the documentation. However, the main concepts and methods remain mostly unchanged.
Breaking Changes
- Removal of methods, notably many old setters/getters replaced by direct access to public properties.
- Many methods and properties have been renamed or merged for better consistency.
- Result stats API has been completely reworked.
- Dropped support for PHP < 8.4.
- Some methods no longer return true if no error occurs. Instead, they return static to allow method chaining.
Added
- Documentation now uses standard PHPDoc tags, compatible with IDEs.
- Brand new documentation book available at https://docs.condorcet.io, replacing the old one.
Changed
- Result objects now expose all their properties as typed, read-only properties instead of getters methods.
- Result stats no longer return as a mixed value (previously: array), but now return an object implementing
StatsInterface.
Dev
- Added Pest mutation testing and advanced static analysis.
- Added some architecture tests.
- PHPStan 2.0 configuration.
- PHP Rector configuration.
- Added some PHPDoc generics.
Version 4.7.0
Description
The minimum PHP version is now 8.3
Added
- CondorcetElectionFormat object can be created directly from a string input instead of only SplFileInfo object.
Dev
- Complete the migration to Pest PHP
Version 4.6.0
Description
Half-migration of tests to PestPHP.
Added
- Experimental WoollyM PHP DataFrame driver.