Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in PHP library and C extension: Reader class marked final #52

Closed
vntw opened this issue Sep 19, 2017 · 1 comment · Fixed by #54
Closed

Discrepancy in PHP library and C extension: Reader class marked final #52

vntw opened this issue Sep 19, 2017 · 1 comment · Fixed by #54

Comments

@vntw
Copy link
Contributor

vntw commented Sep 19, 2017

The Reader class in the C extension is marked final (from what I understand):
https://github.com/maxmind/MaxMind-DB-Reader-php/blob/master/ext/maxminddb.c#L538

And the PHP library is not:
https://github.com/maxmind/MaxMind-DB-Reader-php/blob/master/src/MaxMind/Db/Reader.php#L14

This just came up while developing locally without the C extension and then running the tests in the CI env with the C extension installed which produces different results, for example when mocking the Reader class which will fail in the CI env.

@oschwald
Copy link
Member

The intent was to make both final, but I guess that was not done for the PHP version. These classes were not designed to be subclassed.

That said, declaring the pure PHP version as final now would be a breaking change. A PR to remove the final on the extension along with a test to ensure the behavior of the two is the same would be gladly welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants