src/LocalDate.php
public function withDay(int $day) : LocalDate
    {
        if ($day === $this->day) {
            return $this;
        }

        Field\DayOfMonth::check($day, $this->month, $this->year);

        return new LocalDate($this->year, $this->month, $day);
    }
public function withDay(int $day) : LocalDate
    {
        if ($day === $this->day) {
            return $this;
        }

        Field\DayOfMonth::check($day, $this->month, $this->year);

        return new LocalDate($this->year, $this->month, $day);
    }
public function withDay ( int $ day ) : LocalDate { if ( $ day === $ this -> day ) { return $ this ; } Field \ DayOfMonth :: check ( $ day , $ this -> month , $ this -> year ) ; return new LocalDate ( $ this -> year , $ this -> month , $ day ) ; }
Returns a copy of this LocalDate with the day-of-month altered.

If the resulting date is invalid, an exception is thrown.

@param int $day

@return LocalDate

@throws DateTimeException If the day is invalid for the current year and month.
Returns a copy of this LocalDate with the day - of - month altered .