Commit graph

73 commits

Author SHA1 Message Date
Tim Düsterhus
29f98e7485
Replace @deprecated by #[\Deprecated] for internal functions / class constants (#14750)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-07-10 16:47:31 +02:00
Máté Kocsis
09303ad0e7
Fix some ext/date return types (#14600) 2024-06-18 23:25:09 +02:00
Jorg Adam Sowa
c4d9a37e81
Typed constants in date extension (#12361) 2024-05-22 13:17:44 +02:00
Marc Bennewitz
dbd976a67f
Singular DateTime::[get|set]Microsecond & no tentative return type (#13486)
* Singular DateTime::[get|set]Microsecond & no tentative return type

* Added missing getMicrosecond to DateTimeInterface
2024-03-06 09:18:22 +00:00
Máté Kocsis
f2e199e878
Implement "support doc comments for internal classes and functions" (#13266)
Fixes #13130
2024-02-25 08:41:31 +01:00
Máté Kocsis
10957e498c
Do not generate frameless info items when func info generation is disabled
While here, I fixed newlines around arginfo and function entry generation. Previously, newlines were repeated.
2024-02-18 11:39:00 +01:00
Marc Bennewitz
0016b3085c
Added DateTime[Immutable]::[get|set]Microseconds (#12557)
* Added DateTime[Immutable]::[get|set]Microseconds
2024-02-05 12:14:18 +00:00
Marc Bennewitz
88f2dc6268 Added DateTime[Immutable]::createFromTimestamp / date_create_[immutable]_from_timestamp 2023-11-22 15:24:13 +00:00
Ayesh Karunaratne
27fb8d1c0c
Fix DateTime exception hierarchy for DateInvalidTimeZoneException (#11970)
`DateInvalidTimeZoneException` is supposed to inherit from `DateException`, but the current stub has `Exception`.
2023-08-14 18:55:38 +02:00
Niels Dossche
17b3af2958 GH-11964: In ext/date/php_date.stub.php, DateRangeError extends itself
According to the RFC[1] it's supposed to extend DateError.

[1] https://wiki.php.net/rfc/datetime-exceptions
2023-08-14 13:57:09 +02:00
Máté Kocsis
9c7c0a0b93 Implement DatePeriod::createFromISO8601String() 2023-07-18 12:59:21 +02:00
Ilija Tovilo
7b355e8d34
Revert "Merge branch 'PHP-8.2'"
This reverts commit 45a3f178dc, reversing
changes made to b2a54bc6af.
2023-07-04 09:18:49 +02:00
Máté Kocsis
45a3f178dc
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9967 Add support for generating custom function, class const, and property attributes in stubs

Closes GH-10170
2023-07-03 11:17:08 +02:00
Máté Kocsis
3906bccc00 Add support for typed class constants in stubs 2023-07-01 11:50:04 +02:00
Derick Rethans
b7860cd564 Implement More Appropriate Date/Time Exceptions RFC 2023-02-08 10:27:33 +00:00
Máté Kocsis
e4f2376919
Improve string class constant code generation (#9577)
Using strlen() will make sure that non-constant values can also be used.
2022-09-26 23:12:34 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Derick Rethans
6ae86c2358 Fixed bug #80022: Support ISO 8601 years outside 0000-9999 range better 2022-07-22 15:34:57 +01:00
Máté Kocsis
e328c68305
Rename @cname to @cvalue in stubs (#9043)
@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as @cvalue would be more appropriate.
2022-07-19 15:11:42 +02:00
Máté Kocsis
e13d60c039
DatePeriod properties cannot be made readonly (#9013) 2022-07-19 10:20:45 +02:00
Pierrick Charron
6fd2b39397
Indent with TAB in .h files generated by gen_stub 2022-06-13 08:55:54 -04:00
Máté Kocsis
debd38f851 Add support for sensitive parameters in stubs 2022-06-04 18:15:05 +02:00
Máté Kocsis
21fe72757c
Declare DatePeriod properties (#8534) 2022-05-28 08:43:10 +02:00
Máté Kocsis
14da1cb909
Add support for class constants in stubs (#7434) 2022-05-22 22:27:23 +02:00
Máté Kocsis
8b991b4ae4
Add static return type for DateTime*::createFrom*() when possible
Fix GH-8544
2022-05-13 12:13:48 +02:00
Máté Kocsis
37b3092820
Fix more specific return type hints for some ext/date methods
Ideally, these methods should have been declared with a static return type, so let's add a PHPDoc type hint + a TODO for fixing the issue in the future.
2022-05-13 11:18:26 +02:00
Derick Rethans
d54bcbb43b
Add DatePeriod's __serialize and __unserialize methods (#8464) 2022-05-03 22:06:17 +01:00
Derick Rethans
f869a546e7 Add DateInterval's __serialize and __unserialize methods 2022-04-29 10:27:38 +01:00
Derick Rethans
181623f9c0 Add DateTimeZone's __serialize and __unserialize methods 2022-04-29 09:44:27 +01:00
Derick Rethans
8b2ee5388c Add DateTime/DateTimeImmutable's __serialize and __unserialize methods 2022-04-29 09:44:27 +01:00
Kamil Tekiela
5fbba9b995
getTimestamp does not return false 2021-09-30 09:13:55 +01:00
Máté Kocsis
1bf1481a2a
Specify a few array func info entries (#7425) 2021-08-30 14:29:18 +02:00
Máté Kocsis
8e6e9838b0
Add support for generating MAY_BE_ARRAY_OF_REF func info flag (#7416) 2021-08-30 13:50:34 +02:00
Máté Kocsis
5e424d2884
Fix a few ext/date return types 2021-08-26 15:26:13 +02:00
Máté Kocsis
2d248c80b9
Generate optimizer func info from stubs for ext/date (#7403) 2021-08-25 21:29:46 +02:00
Nikita Popov
4b3615a33f Deprecate strftime() and gmstrftime()
These are deprecated in favor of date()/DateTime::format() (for
locale-indendent formatting) and IntlDateFormatter::format()
(for locale-dependent formatting).

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-14 09:38:43 +02:00
Nikita Popov
5bb83b3778 Deprecate date_sunrise() and date_sunset()
date_sunrise() and date_sunset() are deprecated in favor of
date_sun_info().

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 15:27:08 +02:00
Máté Kocsis
532c60cb92
Add support for tentative return types of internal methods
RFC: https://wiki.php.net/rfc/internal_method_return_types

Closses GH-6971
2021-05-14 15:55:25 +02:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
99b08ac281
Implicitly enable function entry generation when class entry generation is enabled
Closes GH-6675
2021-02-09 13:37:24 +01:00
Máté Kocsis
5f21062054
Generate class entries for a few extensions
Relates to GH-6644
2021-02-03 09:24:09 +01:00
Nikita Popov
c31f9f7ee4 Sync date_diff and DateTime::diff return type
This function/method cannot return false.
2021-01-18 14:39:32 +01:00
Máté Kocsis
46a2c6a8d7
Fix return type of DateTimeImmutable::__set_state() 2020-12-28 14:45:13 +01:00
Christoph M. Becker
269936e680 DateTime*::getOffset() no longer returns false as of PHP 8.0.0
Cf. <https://github.com/php/doc-en/pull/282>.

Closes GH-6539.
2020-12-26 15:13:05 +01:00
Christoph M. Becker
32c6c29d79 Revert "DateTime:: and DateTimeImmutable::getTimestamp() may return false"
This reverts commit b67c232189.
2020-12-20 23:07:02 +01:00
Christoph M. Becker
b67c232189 DateTime:: and DateTimeImmutable::getTimestamp() may return false 2020-12-20 19:32:12 +01:00
Christoph M. Becker
3c68f43251 Fix ext/date stubs
Closes GH-6523.
2020-12-20 18:14:20 +01:00
Máté Kocsis
47bbfe1fc0
Require stubs to declare return types for magic methods when possible
Closes GH-6376
2020-10-23 16:33:16 +02:00
Máté Kocsis
d6264b0966
Verify parameter names of function aliases
Closes GH-6335
2020-10-16 10:56:33 +02:00
Máté Kocsis
186612e4d7
Improve parameter names in ext/intl
Closes GH-6309
2020-10-12 18:06:45 +02:00