| Total Complexity | 9 |
| Total Lines | 76 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 11 | class WordStats |
||
| 12 | { |
||
| 13 | /** @var int Total number of stopwords or good words that we can calculate */ |
||
| 14 | private $stopWordCount = 0; |
||
| 15 | |||
| 16 | /** @var int Total number of words on a node */ |
||
| 17 | private $wordCount = 0; |
||
| 18 | |||
| 19 | /** @var array Holds an actual list of the stop words we found */ |
||
| 20 | private $stopWords = []; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param mixed[] $options |
||
| 24 | */ |
||
| 25 | public function __construct($options = []) { |
||
| 26 | foreach ($options as $key => $value) { |
||
| 27 | $method = 'set' . ucfirst($key); |
||
| 28 | |||
| 29 | if (method_exists($this, $method)) { |
||
| 30 | call_user_func([$this, $method], $value); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return string[] |
||
| 37 | */ |
||
| 38 | public function getStopWords(): array { |
||
| 39 | return $this->stopWords; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string[] $words |
||
| 44 | * |
||
| 45 | * @return self |
||
| 46 | */ |
||
| 47 | public function setStopWords($words): self { |
||
| 48 | $this->stopWords = $words; |
||
| 49 | |||
| 50 | return $this; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return int |
||
| 55 | */ |
||
| 56 | public function getStopWordCount(): int { |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param int $wordCount |
||
| 62 | * |
||
| 63 | * @return self |
||
| 64 | */ |
||
| 65 | public function setStopWordCount(int $wordCount): self { |
||
| 66 | $this->stopWordCount = $wordCount; |
||
| 67 | |||
| 68 | return $this; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return int |
||
| 73 | */ |
||
| 74 | public function getWordCount(): int { |
||
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * @param int $wordCount |
||
| 80 | * |
||
| 81 | * @return self |
||
| 82 | */ |
||
| 83 | public function setWordCount(int $wordCount): self { |
||
| 87 | } |
||
| 88 | } |