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 22
33namespace ApiClients \Client \WeatherUnderground ;
44
5+ use ApiClients \Client \WeatherUnderground \Resource \ConditionInterface ;
56use ApiClients \Client \WeatherUnderground \Resource \UserInterface ;
67use React \EventLoop \Factory ;
78use React \EventLoop \LoopInterface ;
@@ -19,16 +20,16 @@ final class Client
1920 */
2021 private $ client ;
2122
22- public function __construct (AuthenticationInterface $ auth )
23+ public function __construct (string $ token )
2324 {
2425 $ this ->loop = Factory::create ();
25- $ this ->client = AsyncClient::create ($ this ->loop , $ auth );
26+ $ this ->client = AsyncClient::create ($ this ->loop , $ token );
2627 }
2728
28- public function user (string $ user ): UserInterface
29+ public function conditions (string $ location ): ConditionInterface
2930 {
3031 return await (
31- $ this ->client ->user ( $ user ),
32+ $ this ->client ->conditions ( $ location ),
3233 $ this ->loop
3334 );
3435 }
You can’t perform that action at this time.
0 commit comments