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

Sequence::getTotalTimeStampInterval #79

Conversation

Bibendus83
Copy link
Contributor

As asked in #78 I think that this method would be useful everytime you need to calculate the total amount of hours in a calendar.

src/Sequence.php Outdated Show resolved Hide resolved
@Bibendus83
Copy link
Contributor Author

Ok, I just noticed there is a bug when you use this method on a Sequence containing more then 1 Period.
I'm working on it.

@@ -226,7 +226,7 @@ public function getGaps(): self
*/
public function getTotalTimestampInterval(): float
Copy link
Member

Choose a reason for hiding this comment

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

you revert the method name change 😄

Copy link
Contributor Author

@Bibendus83 Bibendus83 Mar 15, 2019

Choose a reason for hiding this comment

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

Yes, as I said your name makes sense if you intend the inner time between the boundaries.
However I intend the total sum of timestamp intervals of the contained Periods.

@nyamsprod nyamsprod merged commit 13c894a into thephpleague:master Mar 16, 2019
@nyamsprod
Copy link
Member

  • I've merge your PR
  • I've slightly updated your implementation to make it more simple IMHO
  • I've added the missing tests and documentation page

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.

2 participants