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

Allow simpler extension of CiDetector [BC break] #94

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

OndraM
Copy link
Owner

@OndraM OndraM commented Jan 17, 2021

Fixes #64 . This is BC break, because we change CiDetector to have final constructor.

Introduce new CiDetectorInterface, so that it can be easily extended by eg. decorator, like they do in Infection.

@@ -30,7 +30,7 @@ class CiDetector
/** @var Env */
private $environment;

public function __construct()
final public function __construct()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not the entire class?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think its necessary to limit usage of the class here. I'm ok with having the class open for extension if someone needs to (and the interface is not enough for whatever reason). As far as they are not able to break the constructor.

@OndraM OndraM added this to the 4.0 milestone Jan 24, 2021
@OndraM OndraM merged commit 4b52987 into main Jan 25, 2021
@OndraM OndraM deleted the feature/ci-detector-interface branch January 25, 2021 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider to introduce an interface
2 participants