Completed
Push — master ( 301bca...63b10a )
by Mārtiņš
02:03
created

MessageItem::exists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Printful\GettextCms\Structures;
5
6
/**
7
 * Class represents a single translation message for saving to or receiving from storage
8
 */
9
class MessageItem
10
{
11
    /**
12
     * Unique 32 char identifier for this message, should be used as the unique key
13
     * @var string
14
     */
15
    public $key = '';
16
17
    /**
18
     * @var string
19
     */
20
    public $locale = '';
21
22
    /**
23
     * @var string
24
     */
25
    public $domain = '';
26
27
    /**
28
     * @var string
29
     */
30
    public $context = '';
31
32
    /**
33
     * @var string
34
     */
35
    public $original = '';
36
37
    /**
38
     * @var string
39
     */
40
    public $translation = '';
41
42
    /**
43
     * Is translation gone from source
44
     * @var bool
45
     */
46
    public $isDisabled = false;
47
48
    /**
49
     * @var string
50
     */
51
    public $originalPlural = '';
52
53
    /**
54
     * List of plural translations
55
     * @var string[]
56
     */
57
    public $pluralTranslations = [];
58
59
    /**
60
     * List of pathnames where this translation exists (with line numbers)
61
     * @var array[] [[file, line], ..]
62
     */
63
    public $references = [];
64
65
    /**
66
     * Comments from the translator
67
     * @var string[]
68
     */
69
    public $comments = [];
70
71
    /**
72
     * Comments from programmer (extracted from source code)
73
     * @var string[]
74
     */
75
    public $extractedComments = [];
76
77
    /**
78
     * @return bool
79
     */
80
    public function exists(): bool
81
    {
82
        return !!$this->key;
83
    }
84
}