Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
AccessRuleType
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
1 / 1
 label
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
3
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\Core\Access\Domain\Model;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11/**
12 * Access rule classification type.
13 *
14 * @package App\Core\Access\Domain\Model
15 */
16enum AccessRuleType: string
17{
18    case MODULE_ACTION = 'module_action';
19    case RECORD_SHARING = 'record_sharing';
20
21    /**
22     * Returns human-readable label.
23     *
24     * @return string English label.
25     */
26    public function label(): string
27    {
28        return match ($this) {
29            self::MODULE_ACTION => 'Module Action / Lock',
30            self::RECORD_SHARING => 'Record Sharing',
31        };
32    }
33}