Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 4035edb

Browse files
author
Petr Knap
committed
Merge branch 'develop' into feature/refactoring
Conflicts: tests/Enum/EnumTest.php
2 parents dc44a57 + a421b93 commit 4035edb

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/Enum/AbstractEnum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public static function getEnumByValue($value)
164164
{
165165
foreach (self::getMembers() as $n => $v) {
166166
if ($value === $v) {
167-
return self::__callStatic($n, []);
167+
return self::__callStatic($n, array());
168168
}
169169
}
170170
throw new EnumNotFoundException(

tests/Enum/EnumTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public function testCallStaticsWorks($name, $expectedValue)
2323

2424
public function dataCallStaticsWorks()
2525
{
26-
return [
27-
["MY_TRUE", 1],
28-
["MY_FALSE", 2],
29-
["MY_NULL", new EnumNotFoundException()]
30-
];
26+
return array(
27+
array("MY_TRUE", 1),
28+
array("MY_FALSE", 2),
29+
array("MY_NULL", new EnumNotFoundException())
30+
);
3131
}
3232

3333
/**
@@ -46,11 +46,11 @@ public function testGetEnumByValueWorks($value, $expectedEnum)
4646

4747
public function dataGetEnumByValueWorks()
4848
{
49-
return [
50-
[1, MyBoolean::MY_TRUE()],
51-
[2, MyBoolean::MY_FALSE()],
52-
[3, new EnumNotFoundException()]
53-
];
49+
return array(
50+
array(1, MyBoolean::MY_TRUE()),
51+
array(2, MyBoolean::MY_FALSE()),
52+
array(3, new EnumNotFoundException())
53+
);
5454
}
5555

5656
public function testComparableWorks()
@@ -64,10 +64,10 @@ public function testComparableWorks()
6464

6565
public function testGetMembersWorks()
6666
{
67-
$this->assertEquals([
67+
$this->assertEquals(array(
6868
"MY_TRUE" => 1,
6969
"MY_FALSE" => 2
70-
], MyBoolean::getMembers());
70+
), MyBoolean::getMembers());
7171
}
7272

7373
/**
@@ -85,9 +85,9 @@ public function testToStringWorks($enum, $expectedString)
8585

8686
public function dataToStringWorks()
8787
{
88-
return [
89-
[MyBoolean::MY_TRUE(), MyBoolean::getClass() . "::MY_TRUE"],
90-
[MyBoolean::MY_FALSE(), MyBoolean::getClass() . "::MY_FALSE"],
91-
];
88+
return array(
89+
array(MyBoolean::MY_TRUE(), MyBoolean::getClass() . "::MY_TRUE"),
90+
array(MyBoolean::MY_FALSE(), MyBoolean::getClass() . "::MY_FALSE")
91+
);
9292
}
9393
}

0 commit comments

Comments
 (0)