| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class Context |
||
| 10 | { |
||
| 11 | private $uid; |
||
| 12 | private $postalCode; |
||
| 13 | private $farmingType; |
||
| 14 | private $contextRepository; |
||
| 15 | |||
| 16 | public function __construct(string $id, string $postalCode, array $farmingType = []) |
||
| 17 | { |
||
| 18 | $this->uid = $id; |
||
| 19 | $this->postalCode = $postalCode; |
||
| 20 | $this->farmingType = $farmingType; |
||
| 21 | $this->contextRepository = app(ContextRepository::class); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function create(string $userId) |
||
| 25 | { |
||
| 26 | $this->contextRepository->add($this, $userId); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function toArray() |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |