| Total Complexity | 6 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | abstract class AbstractData implements \JsonSerializable |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var Result Link to Result object |
||
| 20 | */ |
||
| 21 | protected $result; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string Name |
||
| 25 | */ |
||
| 26 | protected $name; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Set name of object |
||
| 30 | * @param string $name Name |
||
| 31 | */ |
||
| 32 | public function setName(string $name) |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Set object type |
||
| 39 | * @param string $type Type |
||
| 40 | */ |
||
| 41 | public function setType(string $type) |
||
| 42 | { |
||
| 43 | $this->type = $type; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @var string Type |
||
| 48 | */ |
||
| 49 | protected $type; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Get object name |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function getName(): string |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Get object type |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | public function getType(): string |
||
| 65 | { |
||
| 66 | return $this->type ?? 'not available'; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * AbstractData constructor. |
||
| 71 | * @param Result $result |
||
| 72 | */ |
||
| 73 | public function __construct(Result $result) |
||
| 74 | { |
||
| 75 | $this->result = $result; |
||
| 76 | } |
||
| 77 | |||
| 78 | public function jsonSerialize() |
||
| 83 | } |
||
| 84 | } |