OperationType   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A description() 0 7 1
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
}