Skip to content

Commit c9ffe59

Browse files
committed
Reword type changes as performance optimization
1 parent 589c216 commit c9ffe59

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ If it saves you or your team time, please consider [sponsoring its development](
88
### Breaking changes
99

1010
* The SDK supports only actively supported PHP versions. As a result, support for PHP < 8.3 has been dropped;
11-
supported versions are 8.3, 8.4, and 8.5.
11+
supported versions are 8.3, 8.4, and 8.5.
1212
* [Firebase Dynamic Links was shut down on August 25th, 2025](https://firebase.google.com/support/dynamic-links-faq)
1313
and has been removed from the SDK.
1414
* Deprecated classes, methods and class constants have been removed.
15-
* Replaced `Stringable|string` argument types with `string`-only
15+
* Type declarations have been simplified to reduce runtime overhead (e.g., `Stringable|string` to `string`).
1616

1717
See **[UPGRADE-8.0](UPGRADE-8.0.md) for more details on the changes between 7.x and 8.0.**
1818

UPGRADE-8.0.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,16 @@ from 7.x to 8.0.
1212
* [Firebase Dynamic Links was shut down on August 25th, 2025](https://firebase.google.com/support/dynamic-links-faq)
1313
and has been removed from the SDK.
1414

15-
### Replaced `Stringable|string` argument types with `string`-only
15+
### Type simplifications to reduce runtime overhead
1616

17-
Methods that previously accepted `Stringable|string` as argument types now only support `string`.
17+
Several argument types have been simplified to their most common forms to eliminate runtime type conversion overhead.
18+
For example, methods that previously accepted `Stringable|string` now only accept `string`.
1819

19-
`Stringable` was added for convenience so that someone could do, for example
20+
The union types were originally added for convenience, but introduced overhead when processing arguments, requiring
21+
runtime type conversion and validation that could be replaced with static analysis.
2022

21-
```php
22-
$user = $auth->getUser('uid');
23-
$auth->updateUser($user, [...]);
24-
```
25-
26-
While convenient, this adds overhead when processing these arguments. For example, if a method expects a non-empty
27-
string, the SDK would have to do a `trim((string) $arg)` and check if it's empty.
28-
29-
With this change, we can rely only on a `@var non-empty-string $arg` docblock annotation.
30-
31-
```php
32-
$user = $auth->getUser('uid');
33-
$auth->updateUser($user->uid, [...]);
34-
```
23+
**See the complete list of breaking changes below** to identify any adjustments needed. Most changes should (hopefully)
24+
be trivial (e.g., passing `$user->uid` instead of `$user`). Run your test suite to catch any breaking changes.
3525

3626
## Complete list of breaking changes
3727

0 commit comments

Comments
 (0)