| Total Complexity | 6 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php /** @noinspection PhpUnusedPrivateFieldInspection */ |
||
| 21 | class Term |
||
| 22 | { |
||
| 23 | |||
| 24 | private $name = ""; |
||
| 25 | |||
| 26 | private $form = "long"; |
||
| 27 | |||
| 28 | private $single = ""; |
||
| 29 | |||
| 30 | private $multiple = ""; |
||
| 31 | |||
| 32 | private $match = ""; |
||
| 33 | |||
| 34 | private $genderForm = ""; |
||
| 35 | |||
| 36 | private $gender = ""; |
||
| 37 | |||
| 38 | public function __set($name, $value) |
||
| 39 | { |
||
| 40 | $nameParts = explode("-", $name); |
||
| 41 | $attr = ""; |
||
| 42 | for ($i = count($nameParts) - 1; $i >= 0; --$i) { |
||
| 43 | if ($i > 0) { |
||
| 44 | $attr = ucfirst($nameParts[$i]) . $attr; |
||
| 45 | } else { |
||
| 46 | $attr = $nameParts[$i] . $attr; |
||
| 47 | } |
||
| 48 | } |
||
| 49 | if (!isset($this->{$attr})) { |
||
| 50 | throw new InvalidArgumentException("Property \"$attr\" ($name) does not exist in " . __CLASS__); |
||
| 51 | } |
||
| 52 | $this->{$attr} = $value; |
||
| 53 | } |
||
| 54 | |||
| 55 | public function __get($name) |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
|
1 ignored issue
–
show
|
|||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getName() |
||
| 66 | } |
||
| 67 | |||
| 69 |