Skip to content

Commit

Permalink
Use shorthand for initializing the multiFactor request property
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed Mar 4, 2025
1 parent 75d6620 commit e9da2aa
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/Firebase/Request/UpdateUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,7 @@ public function withRemovedEmail(): self
public function withMultiFactors(array $enrollments): self

Check warning on line 228 in src/Firebase/Request/UpdateUser.php

View check run for this annotation

Codecov / codecov/patch

src/Firebase/Request/UpdateUser.php#L228

Added line #L228 was not covered by tests
{
$request = clone $this;

if (is_null($request->multiFactor)) {
$request->multiFactor = [];
}

$request->multiFactor ??= [];
$request->multiFactor['enrollments'] = $enrollments;

Check warning on line 232 in src/Firebase/Request/UpdateUser.php

View check run for this annotation

Codecov / codecov/patch

src/Firebase/Request/UpdateUser.php#L230-L232

Added lines #L230 - L232 were not covered by tests

return $request;

Check warning on line 234 in src/Firebase/Request/UpdateUser.php

View check run for this annotation

Codecov / codecov/patch

src/Firebase/Request/UpdateUser.php#L234

Added line #L234 was not covered by tests
Expand All @@ -241,11 +237,7 @@ public function withMultiFactors(array $enrollments): self
public function resetMultiFactor(): self

Check warning on line 237 in src/Firebase/Request/UpdateUser.php

View check run for this annotation

Codecov / codecov/patch

src/Firebase/Request/UpdateUser.php#L237

Added line #L237 was not covered by tests
{
$request = clone $this;

if (is_null($request->multiFactor)) {
$request->multiFactor = [];
}

$request->multiFactor ??= [];
$request->multiFactor['enrollments'] = [];

Check warning on line 241 in src/Firebase/Request/UpdateUser.php

View check run for this annotation

Codecov / codecov/patch

src/Firebase/Request/UpdateUser.php#L239-L241

Added lines #L239 - L241 were not covered by tests

return $request;

Check warning on line 243 in src/Firebase/Request/UpdateUser.php

View check run for this annotation

Codecov / codecov/patch

src/Firebase/Request/UpdateUser.php#L243

Added line #L243 was not covered by tests
Expand Down

0 comments on commit e9da2aa

Please sign in to comment.