1 | <?php declare(strict_types=1); |
||
18 | class AsyncClient |
||
19 | { |
||
20 | /** |
||
21 | * @var ClientInterface |
||
22 | */ |
||
23 | private $client; |
||
24 | |||
25 | /** |
||
26 | * @param ClientInterface $client |
||
27 | */ |
||
28 | private function __construct(ClientInterface $client) |
||
29 | { |
||
30 | $this->client = $client; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param LoopInterface $loop |
||
35 | * @param string $token |
||
36 | * @param array $options |
||
37 | * @return AsyncClient |
||
38 | */ |
||
39 | public static function create( |
||
40 | LoopInterface $loop, |
||
41 | string $token, |
||
42 | array $options = [] |
||
43 | ): self { |
||
44 | $options = ApiSettings::getOptions($token, $options, 'Async'); |
||
45 | $client = Factory::create($loop, $options); |
||
46 | |||
47 | try { |
||
48 | Scheduler::setAsyncFactory(function () use ($loop) { |
||
49 | return new Scheduler\EventLoopScheduler($loop); |
||
|
|||
50 | }); |
||
51 | } catch (\Throwable $t) { |
||
52 | } |
||
53 | |||
54 | return new self($client); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @internal |
||
59 | * @param ClientInterface $client |
||
60 | * @return AsyncClient |
||
61 | */ |
||
62 | public static function createFromClient(ClientInterface $client): self |
||
63 | { |
||
64 | return new self($client); |
||
65 | } |
||
66 | |||
67 | public function projects(): ObservableInterface |
||
71 | |||
72 | public function project(string $repository): PromiseInterface |
||
76 | |||
77 | public function hasProject(string $provider, string $repository): PromiseInterface |
||
78 | { |
||
79 | return new Promise(function ($resolve, $reject) use ($provider, $repository) { |
||
92 | |||
93 | public function addProject(string $provider, string $repository): PromiseInterface |
||
97 | } |
||
98 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: