Skip to content

Commit 0b8869a

Browse files
committed
add return type declarations #6
1 parent 4203053 commit 0b8869a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/SapDateInterval.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class SapDateInterval extends DateInterval
3838
* @throws Exception
3939
* @link https://php.net/manual/en/dateinterval.createfromdatestring.php
4040
*/
41-
public static function createFromDateString($datetime)
41+
public static function createFromDateString($datetime): DateInterval
4242
{
4343
$matches = [];
4444
if (preg_match('~^([\d]{2})([0-5][\d])([0-5][\d])$~', $datetime, $matches)) {

tests/SapDateIntervalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SapDateIntervalTest extends TestCase
3232
* Data provider for valid time return values from SAP.
3333
* @return array
3434
*/
35-
public static function provideValidTimes()
35+
public static function provideValidTimes(): array
3636
{
3737
return [
3838
['010203', '2020-01-31 00:00:00', '2020-01-31 01:02:03'],

tests/SapDateTimeTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SapDateTimeTest extends TestCase
3434
*
3535
* @return array
3636
*/
37-
public static function validSapWeeks()
37+
public static function validSapWeeks(): array
3838
{
3939
return [
4040
['201846', '2018 week 46', '2018-11-12 00:00:00'],
@@ -69,7 +69,7 @@ public function testParseSapWeeks(string $sapWeek, string $expected, string $tim
6969
*
7070
* @return array
7171
*/
72-
public static function invalidSapWeeks()
72+
public static function invalidSapWeeks(): array
7373
{
7474
return [
7575
['189952'],
@@ -96,7 +96,7 @@ public function testParseInvalidSapWeeks(string $sapWeek)
9696
* Data provider of timestamps and their according SAP week strings.
9797
* @return array
9898
*/
99-
public static function timestampsAndSapWeeks()
99+
public static function timestampsAndSapWeeks(): array
100100
{
101101
return [
102102
['2018-10-19 08:09:10', '201842'],
@@ -127,7 +127,7 @@ public function testCreateSapWeeks(string $timestamp, string $expected)
127127
* Data provider of SAP dates and their ISO date representations.
128128
* @return array
129129
*/
130-
public static function sapDatesAndIsoDates()
130+
public static function sapDatesAndIsoDates(): array
131131
{
132132
return [
133133
['20181101', '2018-11-01 00:00:00'],
@@ -157,7 +157,7 @@ public function testParseSapDates(string $sapDate, string $isoDate)
157157
* Data provider of times and their according SAP time strings.
158158
* @return array
159159
*/
160-
public static function timesAndSapTimes()
160+
public static function timesAndSapTimes(): array
161161
{
162162
return [
163163
['08:10:31', '081031'],
@@ -197,7 +197,7 @@ public function testParseSapTimes(string $isoTime, string $sapTime)
197197
* Data provider of timestamps and their according SAP dates.
198198
* @return array
199199
*/
200-
public static function timestampsAndSapDates()
200+
public static function timestampsAndSapDates(): array
201201
{
202202
return [
203203
['2018-12-21 08:09:10', '20181221'],
@@ -227,7 +227,7 @@ public function testCreateSapDates(string $timestamp, string $sapDate)
227227
* Data provider of timestamps and their according SAP timestamps.
228228
* @return array
229229
*/
230-
public static function timestampsAndSapTimestamps()
230+
public static function timestampsAndSapTimestamps(): array
231231
{
232232
return [
233233
['2018-10-19 08:09:10', '20181019080910'],
@@ -270,7 +270,7 @@ public function testCreateSapTimestamps(string $isotime, string $saptime)
270270
* Data provider for timezones.
271271
* @return array
272272
*/
273-
public static function provideTimezones()
273+
public static function provideTimezones(): array
274274
{
275275
return [
276276
[

0 commit comments

Comments
 (0)