File tree Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 1010$ testToken = '123456789 ' ;
1111
1212$ client = new Client ($ serviceAccountPath );
13- $ client ->applyCredentials ();
1413
1514$ recipient = new Device ($ testToken );
1615
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public function __construct(string $serviceAccountPath)
2121
2222 $ this ->serviceAccountPath = $ serviceAccountPath ;
2323 $ this ->guzzleClient = new \GuzzleHttp \Client ();
24+ $ this ->applyCredentials ();
2425 }
2526
2627 public function setServiceAccountPath (string $ serviceAccountPath ): self
@@ -30,10 +31,11 @@ public function setServiceAccountPath(string $serviceAccountPath): self
3031 }
3132
3233 $ this ->serviceAccountPath = $ serviceAccountPath ;
34+ $ this ->applyCredentials ();
3335 return $ this ;
3436 }
3537
36- public function applyCredentials (): self
38+ private function applyCredentials (): self
3739 {
3840 $ this ->projectId = \json_decode (file_get_contents ($ this ->serviceAccountPath ), true )['project_id ' ];
3941 $ this ->accessToken = $ this ->getAccessToken ();
Original file line number Diff line number Diff line change @@ -9,6 +9,4 @@ interface ClientInterface
99 public function setServiceAccountPath (string $ serviceAccountPath ): self ;
1010
1111 public function send (Notification $ message ): ResponseInterface ;
12-
13- public function applyCredentials (): self ;
1412}
You can’t perform that action at this time.
0 commit comments