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

Adding Period::moveStartDate and Period::moveEndDate #42

Merged
merged 1 commit into from Sep 16, 2016

Conversation

Projects
None yet
2 participants
@nyamsprod
Member

nyamsprod commented Sep 16, 2016

Introduction

With Period::move added to the class we need a mechanism to update each Period endpoint independently using an DateInterval.

Proposal

Describe the new feature

We are adding two methods:

<?php

public Period::moveStartDate($interval): Period
public Period::moveEndDate($interval): Period

Both methods move the endpoint according to a given interval. Depending on the DateInterval->invert property, the interval is either added or removed from the specified endpoint.

Backward Incompatible Changes

None in the current major version.

Targeted release version

3.3

PR Impact

The following methods are deprecated

  • Period::add
  • Period::sub

which are misleading in their name as they both represent a subset of Period::moveEndDate.
These methods will be remove from the next major release.

Open issues

None

Adding Period::moveStartDate and Period::moveEndDate
To complement Period::move we are adding two other method

- Period::moveStartDate
- Period::moveEndDate

Both methods move the datepoint according to a given interval.
Depending on the DateInterval invert property, the interval is
either added or substracted from the datepoint.

We consequently deprecate

- Period::add
- Period::sub

which were at most misleading as they both represent a subset of Period::moveEndDate.
@nyamsprod

This comment has been minimized.

Show comment
Hide comment
@nyamsprod

nyamsprod Sep 16, 2016

Member

@adamnicholson see what you made me do 👍
Tell me what you think of this

Member

nyamsprod commented Sep 16, 2016

@adamnicholson see what you made me do 👍
Tell me what you think of this

@adamnicholson

This comment has been minimized.

Show comment
Hide comment
@adamnicholson

adamnicholson Sep 16, 2016

Contributor

Hah, opened a can of worms.

I definitely agree with this change. I myself was confused about what add() and sub() did at first, I think the new method names are a good improvement

Contributor

adamnicholson commented Sep 16, 2016

Hah, opened a can of worms.

I definitely agree with this change. I myself was confused about what add() and sub() did at first, I think the new method names are a good improvement

@nyamsprod nyamsprod merged commit 694027c into master Sep 16, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment