Comments (4)
I can't reproduce it for a normal use.
The problem is, however, very real and should therefore produce this error, which I can not reproduce.
How did you trigger the error for your use?
However, I am merging your commit. It's better. Thanks.
Even if in principle: I will have to modify the method in the future, because this interface is not designed to return something (http://php.net/manual/en/arrayaccess.offsetunset.php). Perhaps I should rather throw an exception into the parent method and catch her on daughter instead returning a boolean ?
from condorcet.
I found the defect when running the tests in our CI, There we also test the upcoming PHP release.
To reproduce use PHP 7.2.0 (not stable yet):
test.php
<?php
include __DIR__ . '/vendor/autoload.php';
echo PHP_VERSION . PHP_EOL;
new \Condorcet\DataManager\VotesManager();
output:
$ phpnightly test.php
7.2.0-dev
Fatal error: Declaration of Condorcet\DataManager\VotesManager::offsetUnset($offset): void must be compatible with Condorcet\DataManager\ArrayManager::offsetUnset($offset): bool in /home/hboomsma/projects/pnyx/www/vendor/julien-boudry/condorcet/lib/DataManager/VotesManager.php on line 18
Call Stack:
0.0002 416624 1. {main}() /home/hboomsma/projects/pnyx/www/test.php:0
0.0070 742656 2. spl_autoload_call() /home/hboomsma/projects/pnyx/www/test.php:4
0.0070 742720 3. Composer\Autoload\ClassLoader->loadClass() /home/hboomsma/projects/pnyx/www/test.php:4
0.0071 742880 4. Composer\Autoload\includeFile() /home/hboomsma/projects/pnyx/www/vendor/composer/ClassLoader.php:322
0.0075 757064 5. include('/home/hboomsma/projects/pnyx/www/vendor/julien-boudry/condorcet/lib/DataManager/VotesManager.php') /home/hboomsma/projects/pnyx/www/vendor/composer/ClassLoader.php:444
from condorcet.
BTW: Thnx, for your quick response.
Normally I would add an unit test showing the problem before fixing it, but since you did not have any testing platform in use I refrained from adding such a dependency. If you would like it, I could setup PHPUnit for your project and add some basic tests that could run in Travis.
from condorcet.
In fact, this problem seems to concern only PHP 7.2. And this correction solves it.
I also see others new warning with PHP 7.2 nighlty build. But it may be a little early to assess them more precisely.
About PHPUnit. This project from an amateurish developer (me). I do it for fun and level up, so i was a little bit lazy about that kind of things. Preferring build my test as usage examples.
But I will be delighted to see initiatives on this subject! You can start a new branch from dev-1.2.x branch. I will be delighted to watch this and merge it afterwards.
Many thanks.
from condorcet.
Related Issues (20)
- Console: Check false or null php.ini memory_limit on large election HOT 1
- PHP Fatal error HOT 7
- Largest remainder methods: Half votes rounded down, party receiving less seats HOT 5
- Unserialize crash with new && empty election object
- Implement VoteFaire Ranking (Popularity)?
- [Public API Reform] Pairwise key 'null' to 'tie'
- [Public API Reform] Split $election->getResult methods, for filtering by tags
- [Public API Reform] Is it useful to edit candidate name with history. Should be immutable?
- [Public API Reform] Do a really independant Pairwise object HOT 5
- [Command Line] Error importing CondorcetFormat: Argument #1 ($callBack) must be of type Closure HOT 6
- $election->getResult() results in error when there are 0 votes HOT 3
- Investigate about removeVote feature and Pairwise integrity
- Allow either commas or semicolons in Condorcet Election Format HOT 11
- Different results when running different numbers of methods HOT 4
- Problem in Schulze_Proportional_Prefilter in Experimental/Schulze-STV branch HOT 5
- [Public API Reform] Remove static setters setMaxParseIteration / setMaxVoteNumber HOT 1
- Tests: parallel mod (paratest, pest --parallel) fail erratically and inconsistently (and worse with JIT) HOT 3
- [Experimental Schulze-STV Branch] Wrong test results from various methods with Explicit Ranking HOT 14
- New Method: Smith Set HOT 1
- New method: STAR Voting HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from condorcet.