diff --git a/date/date.php b/date/date.php index e95d3a677..22d26351a 100644 --- a/date/date.php +++ b/date/date.php @@ -22,7 +22,7 @@ * @return int|false a timestamp on success, false otherwise. Previous to PHP 5.1.0, * this function would return -1 on failure. */ -#[Pure] +#[Pure(true)] function strtotime(string $datetime, ?int $baseTimestamp): int|false {} /** @@ -293,7 +293,7 @@ function strtotime(string $datetime, ?int $baseTimestamp): int|false {} * timestamp, false is returned and an * E_WARNING level error is emitted. */ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] function date(string $format, ?int $timestamp) {} @@ -390,7 +390,7 @@ function date(string $format, ?int $timestamp) {} * fewer digits than you would expect. See the example below. *

*/ -#[Pure] +#[Pure(true)] function idate(string $format, ?int $timestamp): int|false {} /** @@ -405,7 +405,7 @@ function idate(string $format, ?int $timestamp): int|false {} * timestamp, false is returned and an * E_WARNING level error is emitted. */ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] function gmdate(string $format, ?int $timestamp) {} @@ -459,7 +459,7 @@ function gmdate(string $format, ?int $timestamp) {} * If the arguments are invalid, the function returns false (before PHP 5.1 * it returned -1). */ -#[Pure] +#[Pure(true)] function mktime( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] int $hour = null, #[PhpStormStubsElementAvailable(from: '8.0')] int $hour, @@ -499,7 +499,7 @@ function mktime( *

* @return int|false a integer Unix timestamp. */ -#[Pure] +#[Pure(true)] function gmmktime( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] int $hour = null, #[PhpStormStubsElementAvailable(from: '8.0')] int $hour, @@ -527,7 +527,7 @@ function gmmktime( *

* @return bool true if the date given is valid; otherwise returns false. */ -#[Pure] +#[Pure(true)] function checkdate(int $month, int $day, int $year): bool {} /** @@ -829,7 +829,7 @@ function time(): int {} * "tm_sec" - seconds * @return array */ -#[Pure] +#[Pure(true)] function localtime(?int $timestamp, bool $associative = false): array {} /** @@ -911,7 +911,7 @@ function localtime(?int $timestamp, bool $associative = false): array {} * * */ -#[Pure] +#[Pure(true)] function getdate(?int $timestamp): array {} /** @@ -925,7 +925,7 @@ function getdate(?int $timestamp): array {} *

* @return DateTime|false DateTime object on success or false on failure. */ -#[Pure] +#[Pure(true)] function date_create(string $datetime = 'now', ?DateTimeZone $timezone): DateTime|false {} /** @@ -943,7 +943,7 @@ function date_create(string $datetime = 'now', ?DateTimeZone $timezone): DateTim *

* @return DateTimeImmutable|false DateTime object on success or false on failure. */ -#[Pure] +#[Pure(true)] function date_create_immutable(string $datetime = 'now', ?DateTimeZone $timezone): DateTimeImmutable|false {} /** @@ -954,7 +954,7 @@ function date_create_immutable(string $datetime = 'now', ?DateTimeZone $timezone * @param DateTimeZone|null $timezone [optional] * @return DateTimeImmutable|false */ -#[Pure] +#[Pure(true)] function date_create_immutable_from_format(string $format, string $datetime, ?DateTimeZone $timezone): DateTimeImmutable|false {} /** @@ -970,7 +970,7 @@ function date_create_immutable_from_format(string $format, string $datetime, ?Da * @return DateTime|false

Returns a new * {@see DateTime} instance or FALSE on failure.

*/ -#[Pure] +#[Pure(true)] function date_create_from_format(string $format, string $datetime, ?DateTimeZone $timezone): DateTime|false {} /** @@ -982,7 +982,7 @@ function date_create_from_format(string $format, string $datetime, ?DateTimeZone * @return array|false array with information about the parsed date * on success or false on failure. */ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] function date_parse(string $datetime): false|array {} @@ -997,7 +997,7 @@ function date_parse(string $datetime): false|array {} *

* @return array associative array with detailed info about given date. */ -#[Pure] +#[Pure(true)] function date_parse_from_format(string $format, string $datetime): array {} /** @@ -1019,7 +1019,7 @@ function date_get_last_errors(): array|false {} * @param string $format * @return string|false formatted date string on success or FALSE on failure. */ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] function date_format(DateTimeInterface $object, string $format) {} @@ -1081,7 +1081,7 @@ function date_sub(DateTime $object, DateInterval $interval) {} * or FALSE on failure. *

*/ -#[Pure] +#[Pure(true)] function date_timezone_get(DateTimeInterface $object): DateTimeZone|false {} /** @@ -1108,7 +1108,7 @@ function date_timezone_set(#[LanguageLevelTypeAware(["8.0" => "DateTime"], defau * returned by {@see date_create()}

* @return int|false

Returns the timezone offset in seconds from UTC on success or FALSE on failure.

*/ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "int"], default: "int|false")] function date_offset_get(DateTimeInterface $object) {} @@ -1122,7 +1122,7 @@ function date_offset_get(DateTimeInterface $object) {} * @param bool $absolute [optional] Whether to return absolute difference. * @return DateInterval|false The DateInterval object representing the difference between the two dates or FALSE on failure. */ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "DateInterval"], default: "DateInterval|false")] function date_diff(DateTimeInterface $baseObject, DateTimeInterface $targetObject, bool $absolute = false) {} @@ -1197,7 +1197,7 @@ function date_timestamp_set(DateTime $object, int $timestamp): DateTime|false {} * @param DateTimeInterface $object * @return int

Returns the Unix timestamp representing the date.

*/ -#[Pure] +#[Pure(true)] function date_timestamp_get(DateTimeInterface $object): int {} /** @@ -1209,7 +1209,7 @@ function date_timestamp_get(DateTimeInterface $object): int {} *

* @return DateTimeZone|false DateTimeZone object on success or false on failure. */ -#[Pure] +#[Pure(true)] function timezone_open(string $timezone): DateTimeZone|false {} /** @@ -1220,7 +1220,7 @@ function timezone_open(string $timezone): DateTimeZone|false {} * {@see DateTimeZone} for which to get a name.

* @return string One of the timezone names in the list of timezones. */ -#[Pure] +#[Pure(true)] function timezone_name_get(DateTimeZone $object): string {} /** @@ -1243,7 +1243,7 @@ function timezone_name_get(DateTimeZone $object): string {} * @return string|false time zone name on success or false on failure. * @since 5.1.3 */ -#[Pure] +#[Pure(true)] function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = -1): string|false {} /** @@ -1257,7 +1257,7 @@ function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = * @param DateTimeInterface $datetime

DateTime that contains the date/time to compute the offset from.

* @return int|false

Returns time zone offset in seconds on success or FALSE on failure.

*/ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "int"], default: "int|false")] function timezone_offset_get(DateTimeZone $object, DateTimeInterface $datetime) {} @@ -1273,7 +1273,7 @@ function timezone_offset_get(DateTimeZone $object, DateTimeInterface $datetime) * @param int $timestampEnd [optional]

End timestamp

* @return array|false

Returns numerically indexed array containing associative array with all transitions on success or FALSE on failure.

*/ -#[Pure] +#[Pure(true)] function timezone_transitions_get(DateTimeZone $object, int $timestampBegin, int $timestampEnd): array|false {} /** @@ -1283,7 +1283,7 @@ function timezone_transitions_get(DateTimeZone $object, int $timestampBegin, int * @param DateTimeZone $object

Procedural style only: A {@see DateTimeZone} object returned by {@see timezone_open()}

* @return array|false

Array containing location information about timezone.

*/ -#[Pure] +#[Pure(true)] function timezone_location_get(DateTimeZone $object): array|false {} /** @@ -1296,7 +1296,7 @@ function timezone_location_get(DateTimeZone $object): array|false {} * @return array|false Returns array on success or FALSE on failure. * Note: This option is only used when what is set to DateTimeZone::PER_COUNTRY. */ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] function timezone_identifiers_list(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode) {} @@ -1307,7 +1307,7 @@ function timezone_identifiers_list(int $timezoneGroup = DateTimeZone::ALL, ?stri * @link https://php.net/manual/en/function.timezone-abbreviations-list.php * @return array|false Array on success or FALSE on failure. */ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] function timezone_abbreviations_list() {} @@ -1316,7 +1316,7 @@ function timezone_abbreviations_list() {} * @link https://php.net/manual/en/function.timezone-version-get.php * @return string a string. */ -#[Pure] +#[Pure(true)] function timezone_version_get(): string {} /** @@ -1330,7 +1330,7 @@ function timezone_version_get(): string {} * @return DateInterval|false *

Returns a new DateInterval instance.

*/ -#[Pure] +#[Pure(true)] function date_interval_create_from_date_string(string $datetime): DateInterval|false {} /** @@ -1341,7 +1341,7 @@ function date_interval_create_from_date_string(string $datetime): DateInterval|f * @param string $format * @return string */ -#[Pure] +#[Pure(true)] function date_interval_format(DateInterval $object, string $format): string {} /** @@ -1363,7 +1363,7 @@ function date_default_timezone_set(string $timezoneId): bool {} * @link https://php.net/manual/en/function.date-default-timezone-get.php * @return string a string. */ -#[Pure] +#[Pure(true)] function date_default_timezone_get(): string {} /** @@ -1414,7 +1414,7 @@ function date_default_timezone_get(): string {} * success or false on failure. * @deprecated 8.1 */ -#[Pure] +#[Pure(true)] #[Deprecated(since: '8.1')] function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude, ?float $longitude, ?float $zenith, ?float $utcOffset): string|int|float|false {} @@ -1466,7 +1466,7 @@ function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ? * success or false on failure. * @deprecated 8.1 */ -#[Pure] +#[Pure(true)] #[Deprecated(since: '8.1')] function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude, ?float $longitude, ?float $zenith, ?float $utcOffset): string|int|float|false {} @@ -1485,7 +1485,7 @@ function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?f * @return array|false array on success or false on failure. * @since 5.1.2 */ -#[Pure] +#[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] function date_sun_info(int $timestamp, float $latitude, float $longitude) {}