Skip to content

Commit dbbe4ec

Browse files
committed
Apply PHP 8.3 language migrations
1 parent a841471 commit dbbe4ec

File tree

91 files changed

+330
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+330
-330
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
->setRiskyAllowed(true)
1010
->setRules([
1111
'@PER-CS3x0:risky' => true,
12+
'@PHPUnit9x1Migration:risky' => true,
1213
'class_attributes_separation' => true,
1314
'class_definition' => [
1415
'single_line' => true,

UPGRADE-8.0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ from 7.x to 8.0.
1717
The following list has been generated with [roave/backward-compatibility-check](https://github.com/Roave/BackwardCompatibilityCheck).
1818

1919
```
20+
[BC] CHANGED: The parameter $uid of Kreait\Firebase\Request\EditUserTrait#withUid() changed from no type to Stringable|string
21+
[BC] CHANGED: The parameter $uid of Kreait\Firebase\Request\EditUserTrait#withUid() changed from no type to a non-contravariant Stringable|string
22+
[BC] CHANGED: The parameter $uid of Kreait\Firebase\Request\EditUserTrait#withUid() changed from no type to a non-contravariant Stringable|string
23+
[BC] CHANGED: The parameter $uid of Kreait\Firebase\Request\EditUserTrait#withUid() changed from no type to a non-contravariant Stringable|string
24+
[BC] CHANGED: The return type of Kreait\Firebase\RemoteConfig\ConditionalValue#value() changed from no type to string|array
25+
[BC] CHANGED: The return type of Kreait\Firebase\RemoteConfig\TagColor#__toString() changed from no type to string
2026
[BC] REMOVED: Class Kreait\Firebase\Contract\DynamicLinks has been deleted
2127
[BC] REMOVED: Class Kreait\Firebase\DynamicLink has been deleted
2228
[BC] REMOVED: Class Kreait\Firebase\DynamicLink\AnalyticsInfo has been deleted

src/Firebase/AppCheck.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
/**
1717
* @internal
1818
*/
19-
final class AppCheck implements Contract\AppCheck
19+
final readonly class AppCheck implements Contract\AppCheck
2020
{
2121
public function __construct(
22-
private readonly ApiClient $client,
23-
private readonly AppCheckTokenGenerator $tokenGenerator,
24-
private readonly AppCheckTokenVerifier $tokenVerifier,
22+
private ApiClient $client,
23+
private AppCheckTokenGenerator $tokenGenerator,
24+
private AppCheckTokenVerifier $tokenVerifier,
2525
) {
2626
}
2727

src/Firebase/AppCheck/ApiClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
*
1818
* @phpstan-import-type AppCheckTokenShape from AppCheckToken
1919
*/
20-
final class ApiClient
20+
final readonly class ApiClient
2121
{
2222
public function __construct(
23-
private readonly ClientInterface $client,
24-
private readonly AppCheckApiExceptionConverter $errorHandler,
23+
private ClientInterface $client,
24+
private AppCheckApiExceptionConverter $errorHandler,
2525
) {
2626
}
2727

src/Firebase/AppCheck/AppCheckToken.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* ttl: string
1111
* }
1212
*/
13-
final class AppCheckToken
13+
final readonly class AppCheckToken
1414
{
1515
private function __construct(
16-
public readonly string $token,
17-
public readonly string $ttl,
16+
public string $token,
17+
public string $ttl,
1818
) {
1919
}
2020

src/Firebase/AppCheck/AppCheckTokenGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
*
1515
* @todo Add #[SensitiveParameter] attribute to the private key once the minimum required PHP version is >=8.2
1616
*/
17-
final class AppCheckTokenGenerator
17+
final readonly class AppCheckTokenGenerator
1818
{
19-
private const APP_CHECK_AUDIENCE = 'https://firebaseappcheck.googleapis.com/google.firebase.appcheck.v1.TokenExchangeService';
19+
private const string APP_CHECK_AUDIENCE = 'https://firebaseappcheck.googleapis.com/google.firebase.appcheck.v1.TokenExchangeService';
2020

21-
private readonly ClockInterface $clock;
21+
private ClockInterface $clock;
2222

2323
/**
2424
* @param non-empty-string $clientEmail
2525
* @param non-empty-string $privateKey
2626
*/
2727
public function __construct(
28-
private readonly string $clientEmail,
29-
private readonly string $privateKey,
28+
private string $clientEmail,
29+
private string $privateKey,
3030
?ClockInterface $clock = null,
3131
) {
3232
$this->clock = $clock ?? SystemClock::create();

src/Firebase/AppCheck/AppCheckTokenOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
* ttl?: int|null,
1212
* }
1313
*/
14-
final class AppCheckTokenOptions
14+
final readonly class AppCheckTokenOptions
1515
{
1616
private function __construct(
17-
public readonly ?int $ttl = null,
17+
public ?int $ttl = null,
1818
) {
1919
}
2020

src/Firebase/AppCheck/AppCheckTokenVerifier.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
*
2020
* @phpstan-import-type DecodedAppCheckTokenShape from DecodedAppCheckToken
2121
*/
22-
final class AppCheckTokenVerifier
22+
final readonly class AppCheckTokenVerifier
2323
{
24-
private const APP_CHECK_ISSUER_PREFIX = 'https://firebaseappcheck.googleapis.com/';
24+
private const string APP_CHECK_ISSUER_PREFIX = 'https://firebaseappcheck.googleapis.com/';
2525

2626
/**
2727
* @param non-empty-string $projectId
2828
*/
2929
public function __construct(
30-
private readonly string $projectId,
31-
private readonly CachedKeySet $keySet,
30+
private string $projectId,
31+
private CachedKeySet $keySet,
3232
) {
3333
}
3434

src/Firebase/AppCheck/DecodedAppCheckToken.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
* sub: non-empty-string,
1515
* }
1616
*/
17-
final class DecodedAppCheckToken
17+
final readonly class DecodedAppCheckToken
1818
{
1919
/**
2020
* @param non-empty-string $app_id
2121
* @param array<string> $aud
2222
* @param non-empty-string $sub
2323
*/
2424
private function __construct(
25-
public readonly string $app_id,
26-
public readonly array $aud,
27-
public readonly int $exp,
28-
public readonly int $iat,
29-
public readonly string $iss,
30-
public readonly string $sub,
25+
public string $app_id,
26+
public array $aud,
27+
public int $exp,
28+
public int $iat,
29+
public string $iss,
30+
public string $sub,
3131
) {
3232
}
3333

src/Firebase/AppCheck/VerifyAppCheckTokenResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
* token: DecodedAppCheckTokenShape,
1313
* }
1414
*/
15-
final class VerifyAppCheckTokenResponse
15+
final readonly class VerifyAppCheckTokenResponse
1616
{
1717
/**
1818
* @param non-empty-string $appId
1919
*/
2020
public function __construct(
21-
public readonly string $appId,
22-
public readonly DecodedAppCheckToken $token,
21+
public string $appId,
22+
public DecodedAppCheckToken $token,
2323
) {
2424
}
2525
}

0 commit comments

Comments
 (0)