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

Commit 880ada1

Browse files
author
Petr Knap
committed
Added EnumInterface
1 parent 4035edb commit 880ada1

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

src/Enum/AbstractEnum.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @package PetrKnap\Php\Enum
1313
* @license https://github.com/petrknap/php-enum/blob/master/LICENSE MIT
1414
*/
15-
abstract class AbstractEnum
15+
abstract class AbstractEnum implements EnumInterface
1616
{
1717
/**
1818
* @var self[][]
@@ -78,19 +78,15 @@ public static function __callStatic($memberName, array $args)
7878
}
7979

8080
/**
81-
* Returns member name
82-
*
83-
* @return string
81+
* @inheritdoc
8482
*/
8583
public function getName()
8684
{
8785
return $this->memberName;
8886
}
8987

9088
/**
91-
* Returns member value
92-
*
93-
* @return mixed
89+
* @inheritdoc
9490
*/
9591
public function getValue()
9692
{

src/Enum/EnumInterface.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace PetrKnap\Php\Enum;
4+
5+
interface EnumInterface
6+
{
7+
/**
8+
* Returns member name
9+
*
10+
* @return string
11+
*/
12+
public function getName();
13+
14+
/**
15+
* Returns member value
16+
*
17+
* @return mixed
18+
*/
19+
public function getValue();
20+
}

0 commit comments

Comments
 (0)