| 1 | <?php |
||
| 5 | class Word |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | **/ |
||
| 10 | protected $word; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | **/ |
||
| 15 | protected $length; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | **/ |
||
| 20 | protected $lang; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var float |
||
| 24 | */ |
||
| 25 | protected $complexity; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Constructor |
||
| 29 | * |
||
| 30 | * @param string $word |
||
| 31 | * @param string $lang |
||
| 32 | * @param float $complexity |
||
| 33 | */ |
||
| 34 | 6 | public function __construct($word, $lang, $complexity) |
|
| 35 | { |
||
| 36 | 6 | $this->word = $word; |
|
| 37 | 6 | $this->lang = $lang; |
|
| 38 | 6 | $this->length = strlen($this->word); |
|
| 39 | 6 | $this->complexity = $complexity; |
|
| 40 | 6 | } |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 3 | public function getWord() |
|
| 49 | |||
| 50 | /** |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 3 | public function getLang() |
|
| 57 | |||
| 58 | /** |
||
| 59 | * @return int |
||
| 60 | */ |
||
| 61 | 3 | public function getLength() |
|
| 65 | |||
| 66 | /** |
||
| 67 | * @return float |
||
| 68 | */ |
||
| 69 | 3 | public function getComplexity() |
|
| 73 | } |
||
| 74 |