OperationType::description()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Squareetlabs\VeriFactu\Enums;
6
7
enum OperationType: string
8
{
9
    case SUBJECT_NO_EXEMPT_NO_REVERSE = 'S1';
10
    case SUBJECT_NO_EXEMPT_REVERSE = 'S2';
11
    case NOT_SUBJECT_ARTICLES = 'N1';
12
    case NOT_SUBJECT_LOCALIZATION = 'N2';
13
14
    public function description(): string
15
    {
16
        return match($this) {
17
            self::SUBJECT_NO_EXEMPT_NO_REVERSE => 'Subject and not exempt - No reverse charge',
18
            self::SUBJECT_NO_EXEMPT_REVERSE => 'Subject and not exempt - With reverse charge',
19
            self::NOT_SUBJECT_ARTICLES => 'Not subject - Articles 7, 14, others',
20
            self::NOT_SUBJECT_LOCALIZATION => 'Not subject due to localization rules',
21
        };
22
    }
23
}