@@ -18,7 +18,7 @@ class VestaClient
18
18
19
19
protected string $ tokenIssuer ;
20
20
21
- public function __construct (string $ url = null , string $ secret = null , string $ issuer = null )
21
+ public function __construct (? string $ url = null , ? string $ secret = null , ? string $ issuer = null )
22
22
{
23
23
$ this ->httpClient = new PendingRequest ();
24
24
$ this ->httpClient ->baseUrl ($ url ?? config ('vesta-client.url ' ));
@@ -43,7 +43,7 @@ protected function getJwtBuilder(?string $expireTime = '+2 hour'): Builder
43
43
->expiresAt ($ now ->modify ($ expireTime ?? '+2 hour ' ));
44
44
}
45
45
46
- public function generateApiIdToken (?string $ email , array $ targets , array $ fields , string $ expireTime = null ): string
46
+ public function generateApiIdToken (?string $ email , array $ targets , array $ fields , ? string $ expireTime = null ): string
47
47
{
48
48
$ token = $ this ->getJwtBuilder ($ expireTime )->withClaim ('fields ' , $ fields )->withClaim ('targets ' , $ targets );
49
49
if (isset ($ email )) {
@@ -53,7 +53,7 @@ public function generateApiIdToken(?string $email, array $targets, array $fields
53
53
return $ token ->getToken ($ this ->jwtConfig ->signer (), $ this ->jwtConfig ->signingKey ())->toString ();
54
54
}
55
55
56
- public function retrieveStudent (string $ identifier , string $ userEmail = null , array $ fields = null ): Response
56
+ public function retrieveStudent (string $ identifier , ? string $ userEmail = null , ? array $ fields = null ): Response
57
57
{
58
58
return $ this ->httpClient ->acceptJson ()
59
59
->withToken ($ this ->generateApiIdToken ($ userEmail , [$ identifier ], $ fields ?? ['student_id ' , 'title ' , 'first_name ' , 'last_name ' , 'email ' ]))
0 commit comments