1 | <?php |
||
16 | class Client |
||
17 | { |
||
18 | /** |
||
19 | * @var LoopInterface |
||
20 | */ |
||
21 | protected $loop; |
||
22 | |||
23 | /** |
||
24 | * @var AsyncClient |
||
25 | */ |
||
26 | protected $client; |
||
27 | |||
28 | /** |
||
29 | * @param string $token |
||
30 | */ |
||
31 | public function __construct(string $token = '') |
||
37 | |||
38 | /** |
||
39 | * @param string $repository |
||
40 | * @return RepositoryInterface |
||
41 | */ |
||
42 | public function repository(string $repository): RepositoryInterface |
||
49 | |||
50 | /** |
||
51 | * @return UserInterface |
||
52 | */ |
||
53 | public function user(): UserInterface |
||
60 | |||
61 | /** |
||
62 | * @param int $id |
||
63 | * @return SSHKeyInterface |
||
64 | */ |
||
65 | public function sshKey(int $id): SSHKeyInterface |
||
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | public function hooks(): array |
||
85 | |||
86 | /** |
||
87 | * @return array |
||
88 | */ |
||
89 | public function repositories(): array |
||
98 | |||
99 | /** |
||
100 | * @return array |
||
101 | */ |
||
102 | public function accounts(): array |
||
111 | |||
112 | /** |
||
113 | * @return array |
||
114 | */ |
||
115 | public function broadcasts(): array |
||
124 | } |
||
125 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: