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

Fix: Remove unused field $maxDepth from IsEqual constraint #3335

Closed

Conversation

localheinz
Copy link
Collaborator

This PR

  • removes an unused field $maxDepth from the IsEqual constraint

Related #3180.

πŸ’β€β™‚οΈ $maxDepth still needs to be removed from a lot of other places, which partially constitute BC issues. Happy to work on it, if there are no objections!

@@ -55,7 +50,6 @@ public function __construct($value, float $delta = 0.0, int $maxDepth = 10, bool

$this->value = $value;
$this->delta = $delta;
$this->maxDepth = $maxDepth;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Field is assigned a value, but never used.

Removal of $maxDepth from constructor indicates a BC issue, and should probably be targeted at PHPUnit 8.0, then.

@sebastianbergmann
Copy link
Owner

I would like to understand when $maxDepth stopped being used. I do not recall a (conscious) decision to remove this functionality.

@codecov-io
Copy link

codecov-io commented Oct 10, 2018

Codecov Report

Merging #3335 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3335      +/-   ##
============================================
- Coverage     82.61%   82.61%   -0.01%     
  Complexity     3533     3533              
============================================
  Files           143      143              
  Lines          9331     9330       -1     
============================================
- Hits           7709     7708       -1     
  Misses         1622     1622
Impacted Files Coverage Ξ” Complexity Ξ”
src/Framework/Constraint/IsEqual.php 100% <ΓΈ> (ΓΈ) 9 <0> (ΓΈ) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update 2e5304d...11e65ce. Read the comment docs.

@localheinz
Copy link
Collaborator Author

@sebastianbergmann

I’ll have a look after breakfast!

@localheinz
Copy link
Collaborator Author

@sebastianbergmann

I might be wrong, but I think it is d38ea8f.

To find it, I ran

$ git log -S maxDepth --source --all

Does that make sense?

@sebastianbergmann
Copy link
Owner

Thanks.

It appears that this functionality has not worked for quite some time. Apparently nobody is missing it, I certainly don't miss it, so lets go ahead and remove its remnants.

However, I would like to do this atomically for all occurrences of $maxDepth in time for PHPUnit 8.

@localheinz
Copy link
Collaborator Author

@sebastianbergmann

Do you want to hold off with this until work has started on PHPUnit 8, then? Just to make sure I understand correctly.

@sebastianbergmann
Copy link
Owner

Yes. This will be done in master after PHPUnit 7.5 has been released.

@OskarStark
Copy link
Contributor

Yes. This will be done in master after PHPUnit 7.5 has been released.

But it will be deprecated first, right?

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.

4 participants