1 | <?php declare(strict_types=1); |
||
18 | final class AsyncClient implements AsyncClientInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var ClientInterface |
||
22 | */ |
||
23 | private $client; |
||
24 | |||
25 | /** |
||
26 | * @var RateLimitState |
||
27 | */ |
||
28 | private $rateLimitState; |
||
29 | |||
30 | /** |
||
31 | * @param ClientInterface $client |
||
32 | * @param RateLimitState $rateLimitState |
||
33 | */ |
||
34 | 2 | private function __construct(ClientInterface $client, RateLimitState $rateLimitState) |
|
39 | |||
40 | /** |
||
41 | * @param LoopInterface $loop |
||
42 | * @param AuthenticationInterface $auth |
||
43 | * @param array $options |
||
44 | * @return AsyncClient |
||
45 | */ |
||
46 | 1 | public static function create( |
|
65 | |||
66 | /** |
||
67 | * @internal |
||
68 | * @param ClientInterface $client |
||
69 | * @param RateLimitState $rateLimitState |
||
70 | * @return AsyncClient |
||
71 | */ |
||
72 | 1 | public static function createFromClient(ClientInterface $client, RateLimitState $rateLimitState): self |
|
76 | |||
77 | public function hydrate(string $resource): CancellablePromiseInterface |
||
81 | |||
82 | public function extract(ResourceInterface $resource): CancellablePromiseInterface |
||
86 | |||
87 | public function meta(): PromiseInterface |
||
91 | |||
92 | /** |
||
93 | * @param string $user |
||
94 | * @return PromiseInterface |
||
95 | */ |
||
96 | public function user(string $user): PromiseInterface |
||
100 | |||
101 | /** |
||
102 | * @param string $organization |
||
103 | * @return PromiseInterface |
||
104 | */ |
||
105 | public function organization(string $organization): PromiseInterface |
||
109 | |||
110 | /** |
||
111 | * @return PromiseInterface |
||
112 | */ |
||
113 | public function whoami(): PromiseInterface |
||
117 | |||
118 | /** |
||
119 | * @return Observable |
||
120 | */ |
||
121 | public function emojis(): Observable |
||
125 | |||
126 | public function myOrganizations(): Observable |
||
130 | |||
131 | public function licenses(): Observable |
||
135 | |||
136 | public function watching(): Observable |
||
140 | |||
141 | /** |
||
142 | * @return RateLimitState |
||
143 | */ |
||
144 | 2 | public function getRateLimitState(): RateLimitState |
|
148 | |||
149 | public function rateLimit(): PromiseInterface |
||
153 | |||
154 | public function app(): PromiseInterface |
||
158 | |||
159 | public function renderMarkdown( |
||
172 | } |
||
173 |
Let’s assume that you have a directory layout like this:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: