File tree 3 files changed +3
-4
lines changed 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 10
10
$ testToken = '123456789 ' ;
11
11
12
12
$ client = new Client ($ serviceAccountPath );
13
- $ client ->applyCredentials ();
14
13
15
14
$ recipient = new Device ($ testToken );
16
15
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public function __construct(string $serviceAccountPath)
21
21
22
22
$ this ->serviceAccountPath = $ serviceAccountPath ;
23
23
$ this ->guzzleClient = new \GuzzleHttp \Client ();
24
+ $ this ->applyCredentials ();
24
25
}
25
26
26
27
public function setServiceAccountPath (string $ serviceAccountPath ): self
@@ -30,10 +31,11 @@ public function setServiceAccountPath(string $serviceAccountPath): self
30
31
}
31
32
32
33
$ this ->serviceAccountPath = $ serviceAccountPath ;
34
+ $ this ->applyCredentials ();
33
35
return $ this ;
34
36
}
35
37
36
- public function applyCredentials (): self
38
+ private function applyCredentials (): self
37
39
{
38
40
$ this ->projectId = \json_decode (file_get_contents ($ this ->serviceAccountPath ), true )['project_id ' ];
39
41
$ this ->accessToken = $ this ->getAccessToken ();
Original file line number Diff line number Diff line change @@ -9,6 +9,4 @@ interface ClientInterface
9
9
public function setServiceAccountPath (string $ serviceAccountPath ): self ;
10
10
11
11
public function send (Notification $ message ): ResponseInterface ;
12
-
13
- public function applyCredentials (): self ;
14
12
}
You can’t perform that action at this time.
0 commit comments