| Total Complexity | 8 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | class DatamolinoClient |
||
| 21 | { |
||
| 22 | /** @var Client */ |
||
| 23 | private $client; |
||
| 24 | |||
| 25 | /** @var UserEndpoint */ |
||
| 26 | private $userEndpoint; |
||
| 27 | /** @var AgendaEndpoint */ |
||
| 28 | private $agendaEndpoint; |
||
| 29 | /** @var DocumentEndpoint */ |
||
| 30 | private $documentEndpoint; |
||
| 31 | |||
| 32 | public function __construct() |
||
| 33 | { |
||
| 34 | $this->client = new Client(); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function user(): UserEndpoint |
||
| 38 | { |
||
| 39 | if (null === $this->userEndpoint) { |
||
| 40 | $this->userEndpoint = new UserEndpoint($this->getClient()); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $this->userEndpoint; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function agenda(): AgendaEndpoint |
||
| 47 | { |
||
| 48 | if (null === $this->agendaEndpoint) { |
||
| 49 | $this->agendaEndpoint = new AgendaEndpoint($this->getClient()); |
||
| 50 | } |
||
| 51 | |||
| 52 | return $this->agendaEndpoint; |
||
| 53 | } |
||
| 54 | |||
| 55 | public function document(): DocumentEndpoint |
||
| 56 | { |
||
| 57 | if (null === $this->documentEndpoint) { |
||
| 58 | $this->documentEndpoint = new DocumentEndpoint($this->getClient()); |
||
| 59 | } |
||
| 60 | |||
| 61 | return $this->documentEndpoint; |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @return Client |
||
| 66 | */ |
||
| 67 | public function getClient(): Client |
||
| 70 | } |
||
| 71 | } |
||
| 72 |