-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Create alternative to namespaceMatchesOneOfTheseNamespaces using splat instead of array #403
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #403 +/- ##
=========================================
Coverage 94.33% 94.33%
Complexity 571 571
=========================================
Files 67 67
Lines 1500 1500
=========================================
Hits 1415 1415
Misses 85 85
|
@@ -36,7 +36,7 @@ public function test_should_return_true_if_there_class_is_in_namespace_array(): | |||
{ | |||
$cd = $this->builder->build(); | |||
|
|||
$this->assertTrue($cd->namespaceMatchesOneOfTheseNamespaces(['Fruit'])); | |||
$this->assertTrue($cd->namespaceMatchesOneOfTheseNamespaces('Fruit')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest adding at least another string to show that we can add more arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hgraca Can we continue to support array and the new behavior to not create a BC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest adding at least another string to show that we can add more arguments
I added another string to the test case.
Can we continue to support array and the new behavior to not create a BC?
Do you have a suggestion? Or should I add a new method? (but with what name?)
Also, since the library is not stable yet, I think ppl using this should expect frequent BC breaks and have their dependencies setup accordingly (ie ^0.2
will not automatically update to 0.3
, unlike with stable versions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we can introduce BC but I would like t know if we can maintain a retro-compatibility with this feature :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not sure I understand. :(
We can avoid the BC break by not changing this method signature, and instead add a new method with the new signature.
Does this answer your question?
In this case though, I'm not sure what name to give that method. Suggestions are welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a fixup command adding a new method instead of changing the current method signature.
This avoids the BC break. We can also deprecate the old method and later recreate it with the new signature, for the sake of having a nice method name.
This provides better typing
70eb7a2
to
fb43431
Compare
array
for string ...
array
for string ...
array
for string ...
This provides better typing and ease of use.
This is, however, a BC break.