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 | 2 | * @param ClientInterface $client |
|
32 | * @param RateLimitState $rateLimitState |
||
33 | 2 | */ |
|
34 | 2 | private function __construct(ClientInterface $client, RateLimitState $rateLimitState) |
|
39 | |||
40 | /** |
||
41 | * @param LoopInterface $loop |
||
42 | * @param AuthenticationInterface $auth |
||
43 | 1 | * @param array $options |
|
44 | * @return AsyncClient |
||
45 | */ |
||
46 | public static function create( |
||
65 | |||
66 | /** |
||
67 | * @internal |
||
68 | * @param ClientInterface $client |
||
69 | 1 | * @param RateLimitState $rateLimitState |
|
70 | * @return AsyncClient |
||
71 | 1 | */ |
|
72 | 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 | * @return PromiseInterface |
||
103 | */ |
||
104 | public function whoami(): PromiseInterface |
||
108 | |||
109 | /** |
||
110 | * @return Observable |
||
111 | */ |
||
112 | public function emojis(): Observable |
||
116 | |||
117 | 2 | public function myOrganizations(): Observable |
|
121 | |||
122 | public function licenses(): Observable |
||
126 | |||
127 | public function watching(): Observable |
||
131 | |||
132 | /** |
||
133 | * @return RateLimitState |
||
134 | */ |
||
135 | public function getRateLimitState(): RateLimitState |
||
139 | |||
140 | public function rateLimit(): PromiseInterface |
||
144 | |||
145 | public function renderMarkdown( |
||
157 | } |
||
158 |
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: