| Conditions | 5 |
| Paths | 5 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 68 | public function getPluralFormsCount() |
||
| 69 | { |
||
| 70 | if ($this->nPlurals !== null) { |
||
| 71 | return $this->nPlurals; |
||
| 72 | } |
||
| 73 | |||
| 74 | $key = 'Plural-Forms'; |
||
| 75 | if (!$this->has($key)) { |
||
| 76 | $this->nPlurals = 0; |
||
| 77 | return $this->nPlurals; |
||
| 78 | } |
||
| 79 | |||
| 80 | $header = $this->get('Plural-Forms'); |
||
| 81 | |||
| 82 | $matches = array(); |
||
| 83 | if (preg_match('/nplurals=([0-9]+)/', $header->getValue(), $matches) !== 1) { |
||
| 84 | $this->nPlurals = 0; |
||
| 85 | return $this->nPlurals; |
||
| 86 | } |
||
| 87 | |||
| 88 | $this->nPlurals = isset($matches[1]) ? (int)$matches[1] : 0; |
||
| 89 | |||
| 90 | return $this->nPlurals; |
||
| 91 | } |
||
| 111 |