Project

General

Profile

Actions

Feature #82412

closed

Task #82404: Improve enumeration usage

Add magic static call to enumeration class

Added by Romain Canon over 6 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Start date:
2017-09-09
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.0
Tags:
enumeration,enum
Complexity:
Sprint Focus:

Description

See epic ticket for more information.

Introducing magic static methods calls, to dramatically ease readability:

// Old way:
$myEnum = MyEnum::cast(MyEnum::MY_VALUE);

// New way:
$myEnum = MyEnum::MY_VALUE();
Actions

Also available in: Atom PDF