Skip to content

Commit

Permalink
Remove deprecated methods (#57)
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Kolb <[email protected]>
  • Loading branch information
christian-kolb and Christian Kolb authored Jun 23, 2024
1 parent bf14894 commit 36e1e62
Showing 13 changed files with 4 additions and 919 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

## 0.11.0

- **[Breaking change](./UPGRADE.md#removed-deprecated-isdate-methods-from-moment)**: Removed deprecated `isDate*` methods from `Moment`.
- Added `Clock` implementation with `SystemClock` and `FrozenClock`.
- Added guard methods for comparison methods to `Moment` like `mustBeEqualTo` with option to throw custom exception.

4 changes: 3 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@

## From 0.10.* to 0.11.0

No breaking changes.
### Removed deprecated `isDate*` methods from `Moment`

The `isDate*` methods have all been removed and should be replaced with `is*InTimeZone` methods.

## From 0.9.* to 0.10.0

100 changes: 0 additions & 100 deletions src/Moment.php
Original file line number Diff line number Diff line change
@@ -290,106 +290,6 @@ public function compareTo(self $moment): int
return $this->dateTime <=> $moment->dateTime;
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isAfterInTimeZone instead.
*/
public function isDateAfterInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isAfter(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isNotAfterInTimeZone instead.
*/
public function isDateNotAfterInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isNotAfter(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isAfterOrEqualToInTimeZone instead.
*/
public function isDateAfterOrEqualToInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isAfterOrEqualTo(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isNotAfterOrEqualToInTimeZone instead.
*/
public function isDateNotAfterOrEqualToInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isNotAfterOrEqualTo(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isEqualToInTimeZone instead.
*/
public function isDateEqualToInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isEqualTo(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isNotEqualToInTimeZone instead.
*/
public function isDateNotEqualToInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isNotEqualTo(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isBeforeInTimeZone instead.
*/
public function isDateBeforeInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isBefore(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isNotBeforeInTimeZone instead.
*/
public function isDateNotBeforeInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isNotBefore(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isBeforeOrEqualToInTimeZone instead.
*/
public function isDateBeforeOrEqualToInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isBeforeOrEqualTo(
$moment->dateInTimeZone($timeZone),
);
}

/**
* @deprecated Will be removed in one of the next minor releases. Use @see Date->isNotBeforeOrEqualToInTimeZone instead.
*/
public function isDateNotBeforeOrEqualToInTimeZone(self $moment, \DateTimeZone $timeZone): bool
{
return $this->dateInTimeZone($timeZone)->isNotBeforeOrEqualTo(
$moment->dateInTimeZone($timeZone),
);
}

public function isAtMidnight(): bool
{
return $this
74 changes: 0 additions & 74 deletions tests/Moment/IsDateAfterInTimeZoneTest.php

This file was deleted.

86 changes: 0 additions & 86 deletions tests/Moment/IsDateAfterOrEqualToInTimeZoneTest.php

This file was deleted.

74 changes: 0 additions & 74 deletions tests/Moment/IsDateBeforeInTimeZoneTest.php

This file was deleted.

Loading

0 comments on commit 36e1e62

Please sign in to comment.