Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update date exception thrown #1646

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 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 @@ -249,7 +249,8 @@ public static function getLastErrors(): array|false {}
*/
#[Pure]
#[TentativeType]
public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier): DateTimeImmutable|false {}
#[LanguageLevelTypeAware(['8.4' => 'DateTimeImmutable'], default: 'DateTimeImmutable|false')]
public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier) {}

/**
* (PHP 5 &gt;=5.5.0)<br/>
Expand Down Expand Up @@ -347,6 +348,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 +533,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 @@ -559,10 +561,12 @@ public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ''
* in a format accepted by strtotime().
* @param string $modifier A date/time string. Valid formats are explained in <a href="https://secure.php.net/manual/en/datetime.formats.php">Date and Time Formats</a>.
* @return static|false Returns the DateTime object for method chaining or FALSE on failure.
* @throws DateMalformedStringException
* @link https://php.net/manual/en/datetime.modify.php
*/
#[TentativeType]
public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier): DateTime|false {}
#[LanguageLevelTypeAware(['8.4' => 'DateTime'], default: 'DateTime|false')]
public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier) {}

/**
* Adds an amount of days, months, years, hours, minutes and seconds to a DateTime object
Expand Down Expand Up @@ -763,7 +767,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 +919,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 All @@ -937,7 +941,8 @@ public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ''
* @link https://php.net/manual/en/dateinterval.createfromdatestring.php
*/
#[TentativeType]
public static function createFromDateString(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $datetime): DateInterval|false {}
#[LanguageLevelTypeAware(['8.4' => 'DateInterval'], default: 'DateInterval|false')]
public static function createFromDateString(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $datetime) {}

#[TentativeType]
public function __wakeup(): void {}
Expand Down Expand Up @@ -1041,6 +1046,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
Loading