Skip to content

Commit

Permalink
Merge pull request #394 from cakephp/2.next-setisodate
Browse files Browse the repository at this point in the history
2.next: remove deprecation for setISODate
  • Loading branch information
othercorey authored Apr 26, 2023
2 parents dcccc1e + dff6211 commit 9152534
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/Traits/FrozenTimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,4 @@ public function modify($relative): ChronosInterface

return $new;
}

/**
* @param int $year The year.
* @param int $week The week number.
* @param int $dayOfWeek Day of the week.
* @return mixed
* @deprecated
*/
#[ReturnTypeWillChange]
public function setISODate($year, $week, $dayOfWeek = 1)
{
trigger_error('2.5 setISODate will be removed in 3.x');

return parent::setISODate($year, $week, $dayOfWeek);
}
}
8 changes: 8 additions & 0 deletions tests/TestCase/Date/DateMutabilityConversionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ public function testIsMutableMethod()
});
}

public function testSetISODate()
{
$date = ChronosDate::create(2001, 1, 1);
$new = $date->setISODate(2023, 17, 3);
$this->assertSame('00:00:00', $new->format('H:i:s'));
$this->assertSame('2023-04-26', $new->format('Y-m-d'));
}

protected function checkBothInstances(MutableDate $dt1, ChronosDate $dt2)
{
$this->assertDateTime($dt1, 2001, 2, 3, 0, 0, 0);
Expand Down

0 comments on commit 9152534

Please sign in to comment.