File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use ApiClients \Client \WeatherUnderground \Client ;
4
+ use function ApiClients \Foundation \resource_pretty_print ;
5
+
6
+ require dirname (__DIR__ ) . DIRECTORY_SEPARATOR . 'vendor/autoload.php ' ;
7
+
8
+ $ client = new Client (require 'resolve_token.php ' );
9
+
10
+ resource_pretty_print ($ client ->conditions ('Broek_op_Langedijk ' ));
Original file line number Diff line number Diff line change 2
2
3
3
namespace ApiClients \Client \WeatherUnderground ;
4
4
5
+ use ApiClients \Client \WeatherUnderground \Resource \ConditionInterface ;
5
6
use ApiClients \Client \WeatherUnderground \Resource \UserInterface ;
6
7
use React \EventLoop \Factory ;
7
8
use React \EventLoop \LoopInterface ;
@@ -19,16 +20,16 @@ final class Client
19
20
*/
20
21
private $ client ;
21
22
22
- public function __construct (AuthenticationInterface $ auth )
23
+ public function __construct (string $ token )
23
24
{
24
25
$ this ->loop = Factory::create ();
25
- $ this ->client = AsyncClient::create ($ this ->loop , $ auth );
26
+ $ this ->client = AsyncClient::create ($ this ->loop , $ token );
26
27
}
27
28
28
- public function user (string $ user ): UserInterface
29
+ public function conditions (string $ location ): ConditionInterface
29
30
{
30
31
return await (
31
- $ this ->client ->user ( $ user ),
32
+ $ this ->client ->conditions ( $ location ),
32
33
$ this ->loop
33
34
);
34
35
}
You can’t perform that action at this time.
0 commit comments