Update Carbon to be match inheritence with upstream

This commit is contained in:
Deon George 2024-07-04 10:01:33 +10:00
parent e0333e352a
commit 4e9bdca2f5

View File

@ -13,7 +13,7 @@ class Carbon extends CarbonBase
{
const MONTHS_PER_HALF = 6;
public function __get($name)
public function __get(string $name): mixed
{
switch ($name) {
case 'half':
@ -57,7 +57,7 @@ class Carbon extends CarbonBase
*
* @return static
*/
public function startOfHalf($dayOfWeek = null)
public function startOfHalf(int $dayOfWeek=NULL)
{
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF - 5, 1)->firstOfMonth($dayOfWeek);
}
@ -72,7 +72,7 @@ class Carbon extends CarbonBase
*
* @return static
*/
public function endOfHalf($dayOfWeek = null)
public function endOfHalf(int $dayOfWeek=NULL)
{
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek);
}