summaryrefslogtreecommitdiff
path: root/ext/date
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-10-13 20:03:00 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-10-16 10:56:33 +0200
commitd6264b09665c20ee73d7a1017db0730f9a7c7973 (patch)
treebb465d70db16df73ce28bcc1fadab1a57dd92c02 /ext/date
parent3841ea338ef2508d467efef9ec45d03162ba695d (diff)
downloadphp-git-d6264b09665c20ee73d7a1017db0730f9a7c7973.tar.gz
Verify parameter names of function aliases
Closes GH-6335
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/php_date.stub.php6
-rw-r--r--ext/date/php_date_arginfo.h11
-rw-r--r--ext/date/tests/68062.phpt2
3 files changed, 8 insertions, 11 deletions
diff --git a/ext/date/php_date.stub.php b/ext/date/php_date.stub.php
index c92ea0b4ff..7e22ee23d1 100644
--- a/ext/date/php_date.stub.php
+++ b/ext/date/php_date.stub.php
@@ -69,7 +69,7 @@ function date_time_set(
function date_date_set(DateTime $object, int $year, int $month, int $day): DateTime {}
-function date_isodate_set(DateTime $object, int $year, int $week, int $day = 1): DateTime {}
+function date_isodate_set(DateTime $object, int $year, int $week, int $dayOfWeek = 1): DateTime {}
function date_timestamp_set(DateTime $object, int $timestamp): DateTime {}
@@ -291,7 +291,7 @@ class DateTimeImmutable implements DateTimeInterface
* @return DateInterval|false
* @alias date_diff
*/
- public function diff(DateTimeInterface $object, bool $absolute = false) {}
+ public function diff(DateTimeInterface $targetObject, bool $absolute = false) {}
/** @return DateTimeImmutable|false */
public function modify(string $modifier) {}
@@ -337,7 +337,7 @@ class DateTimeZone
* @return int
* @alias timezone_offset_get
*/
- public function getOffset(DateTimeInterface $object) {}
+ public function getOffset(DateTimeInterface $datetime) {}
/**
* @return array|false
diff --git a/ext/date/php_date_arginfo.h b/ext/date/php_date_arginfo.h
index b716ff1da8..1cd761cca7 100644
--- a/ext/date/php_date_arginfo.h
+++ b/ext/date/php_date_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 561c6ad41ccedfc8b778d3b64323c7154dffcdb5 */
+ * Stub hash: 04954b7aac5b3ee8e789b3ddd254ad5eda299c2b */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtotime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0)
@@ -143,7 +143,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_date_isodate_set, 0, 3, DateTime,
ZEND_ARG_OBJ_INFO(0, object, DateTime, 0)
ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, week, IS_LONG, 0)
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, day, IS_LONG, 0, "1")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dayOfWeek, IS_LONG, 0, "1")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_date_timestamp_set, 0, 2, DateTime, 0)
@@ -335,10 +335,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_DateTimeImmutable_getTimestamp arginfo_class_DateTimeInterface_getTimezone
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeImmutable_diff, 0, 0, 1)
- ZEND_ARG_OBJ_INFO(0, object, DateTimeInterface, 0)
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, absolute, _IS_BOOL, 0, "false")
-ZEND_END_ARG_INFO()
+#define arginfo_class_DateTimeImmutable_diff arginfo_class_DateTimeInterface_diff
#define arginfo_class_DateTimeImmutable_modify arginfo_class_DateTime_modify
@@ -371,7 +368,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_DateTimeZone_getName arginfo_class_DateTimeInterface_getTimezone
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone_getOffset, 0, 0, 1)
- ZEND_ARG_OBJ_INFO(0, object, DateTimeInterface, 0)
+ ZEND_ARG_OBJ_INFO(0, datetime, DateTimeInterface, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone_getTransitions, 0, 0, 0)
diff --git a/ext/date/tests/68062.phpt b/ext/date/tests/68062.phpt
index 3a185e0c71..66f7692cf4 100644
--- a/ext/date/tests/68062.phpt
+++ b/ext/date/tests/68062.phpt
@@ -15,4 +15,4 @@ try {
?>
--EXPECT--
3600
-DateTimeZone::getOffset(): Argument #1 ($object) must be of type DateTimeInterface, int given
+DateTimeZone::getOffset(): Argument #1 ($datetime) must be of type DateTimeInterface, int given