Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Remove final from GoogleAuthenticator class #110

Closed
umpirsky opened this issue Jul 17, 2018 · 5 comments
Closed

Remove final from GoogleAuthenticator class #110

umpirsky opened this issue Jul 17, 2018 · 5 comments

Comments

@umpirsky
Copy link

Final blocks 2.0 upgrade for scheb/two-factor-bundle#147.

Will you consider making it possible to extend?

@kunicmarko20
Copy link

kunicmarko20 commented Jul 17, 2018

I'm intentionally using version 1.1 of the Sonata bundle because for whatever reason the GoogleAuthenticator class is final in the 2.0 version, which makes it impossible to mock it in test cases.

This is not the reason for us to remove the final and there are other ways to write tests. We use final so people won't extend the classes which are not meant to be extended and make us unable to do changes to classes without a BC Breaks because there is someone that extended that class.

Still, that class should have an interface, and that would solve your "problem" with tests?

Not sure if we can introduce an interface without it being a BC Break, cc @greg0ire wdyt?

Since the class is final we probably can just add an interface and release a minor version with it.

@umpirsky
Copy link
Author

umpirsky commented Jul 17, 2018

That's what I assumed, thanks for confirmation.

If final answer is no, just close the issue.

Хвала!

@greg0ire
Copy link

I'm OK with adding an interface 👍

@OskarStark
Copy link
Member

Me, too

@umpirsky are you willing to create a PR?

@umpirsky
Copy link
Author

Done #111.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants