Skip to content

Commit

Permalink
Update date exception thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed May 29, 2024
1 parent 5d05b72 commit 936c45f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions date/date_c.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class DateTimeImmutable implements DateTimeInterface
* The <em>$timezone</em> parameter and the current timezone are ignored when the <em>$datetime</em> parameter either
* is a UNIX timestamp (e.g. <em>@946684800</em>) or specifies a timezone (e.g. <em>2010-01-28T15:00:00+02:00</em>).
* </p></blockquote>
* @throws Exception Emits Exception in case of an error.
* @throws DateMalformedStringException Emits Exception in case of an error.
*/
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $datetime = "now",
Expand Down Expand Up @@ -347,6 +347,7 @@ public function setTimezone(DateTimeZone $timezone): DateTimeImmutable {}
* A {@link https://secure.php.net/manual/en/class.dateinterval.php DateInterval} object
* </p>
* @return static
* @throws DateInvalidOperationException
* Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or <b>FALSE</b> on failure.
*/
#[TentativeType]
Expand Down Expand Up @@ -531,7 +532,7 @@ class DateTime implements DateTimeInterface
* or specifies a timezone
* (e.g. <em>2010-01-28T15:00:00+02:00</em>).
* </p> <p></p></blockquote>
* @throws Exception Emits Exception in case of an error.
* @throws DateMalformedStringException Emits Exception in case of an error.
*/
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $datetime = 'now',
Expand Down Expand Up @@ -763,7 +764,7 @@ class DateTimeZone
/**
* @param string $timezone
* @link https://php.net/manual/en/datetimezone.construct.php
* @throws Exception Emits Exception in case of an error.
* @throws DateInvalidTimeZoneException Emits Exception in case of an error.
*/
public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $timezone) {}

Expand Down Expand Up @@ -915,7 +916,7 @@ class DateInterval

/**
* @param string $duration
* @throws Exception when the $duration cannot be parsed as an interval.
* @throws DateMalformedIntervalStringException when the $duration cannot be parsed as an interval.
* @link https://php.net/manual/en/dateinterval.construct.php
*/
public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $duration) {}
Expand Down Expand Up @@ -1041,6 +1042,7 @@ public function __construct(DateTimeInterface $start, DateInterval $interval, $r
/**
* @param string $isostr String containing the ISO interval.
* @param int $options Can be set to DatePeriod::EXCLUDE_START_DATE.
* @throws DateMalformedPeriodStringException
* @link https://php.net/manual/en/dateperiod.construct.php
*/
public function __construct($isostr, $options = 0) {}
Expand Down

0 comments on commit 936c45f

Please sign in to comment.