Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 64871d8

Browse files
committed
Fix error Enum value objects
1 parent 76d7c2e commit 64871d8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

‎src/Enum/Enum.php‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ abstract class Enum implements ValueObjectInterface
4242
*/
4343
public function __construct($value)
4444
{
45-
if ($value instanceof static) {
46-
$value = $value->getValue();
47-
}
48-
45+
Assert::notEmpty($value);
4946
Assert::oneOf($value, $this->toArray());
5047

5148
$this->value = $value;
@@ -80,7 +77,7 @@ public static function __callStatic($name, $arguments)
8077
*
8178
* @return string
8279
*/
83-
protected static function convertUnCamelCase($name): string
80+
private static function convertUnCamelCase($name): string
8481
{
8582
return strtoupper(preg_replace('/([a-z])([A-Z])/', "\\1_\\2", $name));
8683
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /