Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
12 / 12
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
StructureType
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
10
100.00% covered (success)
100.00%
1 / 1
 label
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
10
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Modules\Structure\Domain\Model;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11/**
12 * Enumeration of Organizational Structure Node Types.
13 *
14 * @package App\Modules\Structure\Domain\Model
15 */
16enum StructureType: string
17{
18    case HEADQUARTERS = 'headquarters';
19    case BRANCH = 'branch';
20    case AFFILIATE = 'affiliate';
21    case DEPARTMENT = 'department';
22    case DIVISION = 'division';
23    case DIRECTOR = 'director';
24    case MANAGER = 'manager';
25    case TEAM = 'team';
26    case EMPLOYEE = 'employee';
27
28    /**
29     * Returns human-readable default label.
30     *
31     * @return string
32     */
33    public function label(): string
34    {
35        return match ($this) {
36            self::HEADQUARTERS => 'Headquarters',
37            self::BRANCH       => 'Branch',
38            self::AFFILIATE    => 'Affiliate',
39            self::DEPARTMENT   => 'Department',
40            self::DIVISION     => 'Division / Section',
41            self::DIRECTOR     => 'Directorship',
42            self::MANAGER      => 'Management',
43            self::TEAM         => 'Team / Group',
44            self::EMPLOYEE     => 'Position / Role',
45        };
46    }
47}