| Conditions | 5 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | 4 | public function getFrequency() |
|
| 51 | { |
||
| 52 | 4 | if (empty($this->frequencies) && $this->getText()->count()) { |
|
| 53 | 4 | foreach ($this->getText() as $word) { |
|
| 54 | 4 | if (!isset($this->frequencies[$word->getPlain()])) { |
|
| 55 | 4 | $this->frequencies[$word->getPlain()] = 0; |
|
| 56 | } |
||
| 57 | 4 | ++$this->frequencies[$word->getPlain()]; |
|
| 58 | } |
||
| 59 | 4 | arsort($this->frequencies); |
|
| 60 | } |
||
| 61 | |||
| 62 | 4 | return $this->frequencies; |
|
| 63 | } |
||
| 82 |