Update Carbon to be match inheritence with upstream
This commit is contained in:
parent
e0333e352a
commit
4e9bdca2f5
@ -13,7 +13,7 @@ class Carbon extends CarbonBase
|
|||||||
{
|
{
|
||||||
const MONTHS_PER_HALF = 6;
|
const MONTHS_PER_HALF = 6;
|
||||||
|
|
||||||
public function __get($name)
|
public function __get(string $name): mixed
|
||||||
{
|
{
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
case 'half':
|
case 'half':
|
||||||
@ -57,7 +57,7 @@ class Carbon extends CarbonBase
|
|||||||
*
|
*
|
||||||
* @return static
|
* @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);
|
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
|
* @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);
|
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user