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

Commit 1e63f47

Browse files
author
Petr Knap
committed
findByValue rename to getEnumByValue
1 parent 84ce14f commit 1e63f47

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Enum/AbstractEnum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private function get($memberName)
160160
* @return self
161161
* @throws EnumNotFoundException
162162
*/
163-
public static function findByValue($value)
163+
public static function getEnumByValue($value)
164164
{
165165
foreach (self::getMembers() as $n => $v) {
166166
if ($value === $v) {

tests/Enum/EnumTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ public function dataCallStaticsWorks()
3131
}
3232

3333
/**
34-
* @dataProvider dataFindByValueWorks
34+
* @dataProvider dataGetEnumByValueWorks
3535
* @param mixed $value
3636
* @param mixed $expectedEnum
3737
*/
38-
public function testFindByValueWorks($value, $expectedEnum)
38+
public function testGetEnumByValueWorks($value, $expectedEnum)
3939
{
4040
if ($expectedEnum instanceof \Exception) {
4141
$this->setExpectedException(get_class($expectedEnum));
4242
}
4343

44-
$this->assertSame($expectedEnum, MyBoolean::findByValue($value));
44+
$this->assertSame($expectedEnum, MyBoolean::getEnumByValue($value));
4545
}
4646

47-
public function dataFindByValueWorks()
47+
public function dataGetEnumByValueWorks()
4848
{
4949
return [
5050
[1, MyBoolean::MY_TRUE()],

0 commit comments

Comments
 (0)