src/Period.php
public function normalized() : Period
    {
        $totalMonths = $this->years * LocalTime::MONTHS_PER_YEAR + $this->months;

        $splitYears = \intdiv($totalMonths, 12);
        $splitMonths = $totalMonths % 12;

        if ($splitYears === $this->years || $splitMonths === $this->months) {
            return $this;
        }

        return new Period($splitYears, $splitMonths, $this->days);
    }
public function normalized() : Period
    {
        $totalMonths = $this->years * LocalTime::MONTHS_PER_YEAR + $this->months;

        $splitYears = \intdiv($totalMonths, 12);
        $splitMonths = $totalMonths % 12;

        if ($splitYears === $this->years || $splitMonths === $this->months) {
            return $this;
        }

        return new Period($splitYears, $splitMonths, $this->days);
    }
public function normalized ( ) : Period { $ totalMonths = $ this -> years * LocalTime :: MONTHS_PER_YEAR + $ this -> months ; $ splitYears = \ intdiv ( $ totalMonths , 12 ) ; $ splitMonths = $ totalMonths % 12 ; if ( $ splitYears === $ this -> years || $ splitMonths === $ this -> months ) { return $ this ; } return new Period ( $ splitYears , $ splitMonths , $ this -> days ) ; }
Returns a copy of this Period with the years and months normalized.

This normalizes the years and months units, leaving the days unit unchanged.
The months unit is adjusted to have an absolute value less than 12,
with the years unit being adjusted to compensate. For example, a period of
"1 year and 15 months" will be normalized to "2 years and 3 months".

The sign of the years and months units will be the same after normalization.
For example, a period of "1 year and -25 months" will be normalized to
"-1 year and -1 month".

@return Period
Returns a copy of this Period with the years and months normalized .