kreait / firebase-php

@@ -38,6 +38,11 @@
Loading
38 38
        return $this->action->settings();
39 39
    }
40 40
41 +
    public function tenantId(): ?string
42 +
    {
43 +
        return $this->action->tenantId();
44 +
    }
45 +
41 46
    public function locale(): ?string
42 47
    {
43 48
        return $this->locale;

@@ -246,8 +246,10 @@
Loading
246 246
                : ValidatedActionCodeSettings::fromArray($actionCodeSettings);
247 247
        }
248 248
249 +
        $tenantId = $this->tenantId ? $this->tenantId->toString() : null;
250 +
249 251
        return (new CreateActionLink\GuzzleApiClientHandler($this->client))
250 -
            ->handle(CreateActionLink::new($type, $email, $actionCodeSettings));
252 +
            ->handle(CreateActionLink::new($type, $email, $actionCodeSettings, $tenantId));
251 253
    }
252 254
253 255
    public function sendEmailActionLink(string $type, $email, $actionCodeSettings = null, ?string $locale = null): void
@@ -262,7 +264,9 @@
Loading
262 264
                : ValidatedActionCodeSettings::fromArray($actionCodeSettings);
263 265
        }
264 266
265 -
        $createAction = CreateActionLink::new($type, $email, $actionCodeSettings);
267 +
        $tenantId = $this->tenantId ? $this->tenantId->toString() : null;
268 +
269 +
        $createAction = CreateActionLink::new($type, $email, $actionCodeSettings, $tenantId);
266 270
        $sendAction = new SendActionLink($createAction, $locale);
267 271
268 272
        if (\mb_strtolower($type) === 'verify_email') {

@@ -18,16 +18,20 @@
Loading
18 18
    /** @var ActionCodeSettings|null */
19 19
    private $settings;
20 20
21 +
    /** @var string|null */
22 +
    private $tenantId;
23 +
21 24
    private function __construct()
22 25
    {
23 26
    }
24 27
25 -
    public static function new(string $type, Email $email, ActionCodeSettings $settings): self
28 +
    public static function new(string $type, Email $email, ActionCodeSettings $settings, ?string $tenantId = null): self
26 29
    {
27 30
        $instance = new self();
28 31
        $instance->type = $type;
29 32
        $instance->email = $email;
30 33
        $instance->settings = $settings;
34 +
        $instance->tenantId = $tenantId;
31 35
32 36
        return $instance;
33 37
    }
@@ -46,4 +50,9 @@
Loading
46 50
    {
47 51
        return $this->settings ?? ValidatedActionCodeSettings::empty();
48 52
    }
53 +
54 +
    public function tenantId(): ?string
55 +
    {
56 +
        return $this->tenantId;
57 +
    }
49 58
}

@@ -18,10 +18,11 @@
Loading
18 18
    {
19 19
        $uri = Utils::uriFor('https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode');
20 20
21 -
        $data = [
21 +
        $data = \array_filter([
22 22
            'requestType' => $action->type(),
23 23
            'email' => $action->email(),
24 -
        ] + $action->settings()->toArray();
24 +
            'tenantId' => $action->tenantId(),
25 +
        ]) + $action->settings()->toArray();
25 26
26 27
        if ($idTokenString = $action->idTokenString()) {
27 28
            $data['idToken'] = $idTokenString;

@@ -18,11 +18,12 @@
Loading
18 18
    {
19 19
        $uri = Utils::uriFor('https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode');
20 20
21 -
        $data = [
21 +
        $data = \array_filter([
22 22
            'requestType' => $action->type(),
23 23
            'email' => $action->email(),
24 24
            'returnOobLink' => true,
25 -
        ] + $action->settings()->toArray();
25 +
            'tenantId' => $action->tenantId(),
26 +
        ]) + $action->settings()->toArray();
26 27
27 28
        $body = Utils::streamFor(\json_encode($data));
28 29
Files Complexity Coverage
src/Firebase 1,558 92.79%
Project Totals (150 files) 1558 92.79%
1
comment:
2
  layout: "reach,diff"
3

4
coverage:
5
  status:
6
    project:
7
      default:
8
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading