| Conditions | 5 |
| Paths | 5 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function getPluralFormsCount() |
||
| 19 | { |
||
| 20 | if ($this->nPlurals !== null) { |
||
| 21 | return $this->nPlurals; |
||
| 22 | } |
||
| 23 | |||
| 24 | $header = $this->getHeaderValue('Plural-Forms'); |
||
| 25 | if ($header === null) { |
||
| 26 | $this->nPlurals = 0; |
||
| 27 | return $this->nPlurals; |
||
| 28 | } |
||
| 29 | |||
| 30 | $matches = array(); |
||
| 31 | if (\preg_match('/nplurals=([0-9]+)/', $header, $matches) !== 1) { |
||
| 32 | $this->nPlurals = 0; |
||
| 33 | return $this->nPlurals; |
||
| 34 | } |
||
| 35 | |||
| 36 | $this->nPlurals = isset($matches[1]) ? (int)$matches[1] : 0; |
||
| 37 | |||
| 38 | return $this->nPlurals; |
||
| 39 | } |
||
| 71 |