| Total Complexity | 10 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | trait ReadTrait |
||
| 10 | { |
||
| 11 | public function GetFoo() : string |
||
| 12 | { |
||
| 13 | return $this->RetrievePropertyValueFromData('Foo'); |
||
| 14 | } |
||
| 15 | |||
| 16 | public function GetBar() : float |
||
| 17 | { |
||
| 18 | $out = $this->RetrievePropertyValueFromData('Bar'); |
||
| 19 | |||
| 20 | if (is_string($out) === true && is_numeric($out)) { |
||
| 21 | return (float) $out; |
||
| 22 | } |
||
| 23 | |||
| 24 | return $out; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function GetBaz() : int |
||
| 28 | { |
||
| 29 | $out = $this->RetrievePropertyValueFromData('Baz'); |
||
| 30 | |||
| 31 | if (is_string($out) === true && is_numeric($out)) { |
||
| 32 | return (int) $out; |
||
| 33 | } |
||
| 34 | |||
| 35 | return $out; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function GetBat() : ? bool |
||
| 39 | { |
||
| 40 | $out = $this->RetrievePropertyValueFromData('Bat'); |
||
| 41 | |||
| 42 | if (is_string($out) === true && is_numeric($out)) { |
||
| 43 | return (bool) ((int) $out); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $out; |
||
| 47 | } |
||
| 49 |