Skip to content

Commit 7beaca3

Browse files
committed
fix inherited parameter's name #6
1 parent e026aef commit 7beaca3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/SapDateInterval.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ class SapDateInterval extends DateInterval
3333

3434
/**
3535
* Sets up a DateInterval from the relative parts of the string
36-
* @param string $time
36+
* @param string $datetime
3737
* @return DateInterval
3838
* @throws Exception
3939
* @link https://php.net/manual/en/dateinterval.createfromdatestring.php
4040
*/
41-
public static function createFromDateString($time)
41+
public static function createFromDateString($datetime)
4242
{
4343
$matches = [];
44-
if (preg_match('~^([\d]{2})([0-5][\d])([0-5][\d])$~', $time, $matches)) {
44+
if (preg_match('~^([\d]{2})([0-5][\d])([0-5][\d])$~', $datetime, $matches)) {
4545
return new parent(sprintf(
4646
'PT%sH%sM%sS',
4747
$matches[1],
4848
$matches[2],
4949
$matches[3]
5050
));
5151
}
52-
return parent::createFromDateString($time);
52+
return parent::createFromDateString($datetime);
5353
}
5454
}

src/SapDateTime.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function createFromSapWeek($sapWeek, $timezone = null)
7676
* Parse a string into a new DateTime object according to the specified format.
7777
*
7878
* @param string $format Format accepted by date().
79-
* @param string $time String representing the time.
79+
* @param string $datetime String representing the time.
8080
* @param DateTimeZone $timezone A DateTimeZone object representing the desired
8181
* time zone.
8282
* @return DateTime|bool
@@ -86,19 +86,19 @@ public static function createFromSapWeek($sapWeek, $timezone = null)
8686
*/
8787
public static function createFromFormat(
8888
$format,
89-
$time,
89+
$datetime,
9090
$timezone = null
9191
) {
9292
if ($format === static::SAP_WEEK) {
93-
return static::createFromSapWeek($time, $timezone);
93+
return static::createFromSapWeek($datetime, $timezone);
9494
}
9595
if ($format === static::SAP_DATE) {
96-
$result = parent::createFromFormat($format, $time, $timezone);
96+
$result = parent::createFromFormat($format, $datetime, $timezone);
9797
if ($result !== false) {
9898
$result->setTime(0, 0, 0);
9999
}
100100
return $result;
101101
}
102-
return parent::createFromFormat($format, $time, $timezone);
102+
return parent::createFromFormat($format, $datetime, $timezone);
103103
}
104104
}

0 commit comments

Comments
 (0)