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

Remove deprecated methods #57

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 3 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
100 changes: 0 additions & 100 deletions src/Moment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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
Loading