| Total Complexity | 9 |
| Total Lines | 123 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Language |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | private $name; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | private $localName; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $alpha3; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | private $scope; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string |
||
| 31 | */ |
||
| 32 | private $type; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | private $invertedName; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var string |
||
| 41 | */ |
||
| 42 | private $alpha2; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param string $name |
||
| 46 | * @param string $alpha3 |
||
| 47 | * @param string $scope |
||
| 48 | * @param string $type |
||
| 49 | * @param string|null $invertedName |
||
| 50 | * @param string|null $alpha2 |
||
| 51 | */ |
||
| 52 | public function __construct( |
||
| 53 | $name, |
||
| 54 | $alpha3, |
||
| 55 | $scope, |
||
| 56 | $type, |
||
| 57 | $invertedName = null, |
||
| 58 | $alpha2 = null |
||
| 59 | ) { |
||
| 60 | $this->name = $name; |
||
| 61 | $this->alpha3 = $alpha3; |
||
| 62 | $this->scope = $scope; |
||
| 63 | $this->type = $type; |
||
| 64 | $this->invertedName = $invertedName; |
||
| 65 | $this->alpha2 = $alpha2; |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return string |
||
| 70 | */ |
||
| 71 | public function getName() |
||
| 72 | { |
||
| 73 | return $this->name; |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return string |
||
| 78 | */ |
||
| 79 | public function getLocalName() |
||
| 80 | { |
||
| 81 | if ($this->localName === null) { |
||
| 82 | $this->localName = dgettext( |
||
| 83 | Languages::getISONumber(), |
||
| 84 | $this->name |
||
| 85 | ); |
||
| 86 | |||
| 87 | } |
||
| 88 | |||
| 89 | return $this->localName; |
||
| 90 | } |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @return string |
||
| 94 | */ |
||
| 95 | public function getAlpha3() |
||
| 96 | { |
||
| 97 | return $this->alpha3; |
||
| 98 | } |
||
| 99 | |||
| 100 | /** |
||
| 101 | * @return string |
||
| 102 | */ |
||
| 103 | public function getScope() |
||
| 104 | { |
||
| 105 | return $this->scope; |
||
| 106 | } |
||
| 107 | |||
| 108 | /** |
||
| 109 | * @return string |
||
| 110 | */ |
||
| 111 | public function getType() |
||
| 112 | { |
||
| 113 | return $this->type; |
||
| 114 | } |
||
| 115 | |||
| 116 | /** |
||
| 117 | * @return string|null |
||
| 118 | */ |
||
| 119 | public function getInvertedName() |
||
| 122 | } |
||
| 123 | |||
| 124 | /** |
||
| 125 | * @return string|null |
||
| 126 | */ |
||
| 127 | public function getAlpha2() |
||
| 130 | } |
||
| 131 | } |
||
| 132 |