Skip to content

Commit 9da8054

Browse files
Restore #[SensitiveParameter] attributes
Co-Authored-By: Alexander Kravchenko <[email protected]>
1 parent 74d80b8 commit 9da8054

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

.php-cs-fixer.dist.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@
1616
'concat_space' => [
1717
'spacing' => 'none',
1818
],
19+
'fully_qualified_strict_types' => [
20+
'import_symbols' => true,
21+
'leading_backslash_in_global_namespace' => true,
22+
],
1923
'method_argument_space' => [
20-
'attribute_placement' => 'same_line',
24+
'attribute_placement' => 'standalone', // same_line can break PHP <8.2
2125
],
2226
'no_unused_imports' => true,
2327
'ordered_imports' => [

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Please read about the future of the Firebase Admin PHP SDK on the
77

88
## [Unreleased]
99

10+
## Added
11+
12+
* Re-added the `#[SensitiveParameter]` attribute because, while it's not supported in PHP 8.1, it can still be used
13+
if placed in a standalone line above the variable or property.
14+
1015
## [7.21.1] - 2025-07-24
1116

1217
### Fixed

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
earlyReturn: true,
2020
phpunitCodeQuality: true,
2121
)
22-
->withImportNames(removeUnusedImports: true)
22+
->withImportNames(importShortClasses: false, removeUnusedImports: true)
2323
;

src/Firebase/AppCheck/AppCheckTokenGenerator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
/**
1313
* @internal
14-
*
15-
* @todo Add #[SensitiveParameter] attribute to the private key once the minimum required PHP version is >=8.2
1614
*/
1715
final class AppCheckTokenGenerator
1816
{
@@ -26,6 +24,7 @@ final class AppCheckTokenGenerator
2624
*/
2725
public function __construct(
2826
private readonly string $clientEmail,
27+
#[\SensitiveParameter]
2928
private readonly string $privateKey,
3029
?ClockInterface $clock = null,
3130
) {

src/Firebase/ServiceAccount.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,44 @@
66

77
/**
88
* @internal
9-
*
10-
* @todo Add #[SensitiveParameter] attributes once the minimum required PHP version is >=8.2
119
*/
1210
final class ServiceAccount
1311
{
1412
public function __construct(
1513
/** @var non-empty-string */
1614
public string $type,
1715
/** @var non-empty-string */
16+
#[\SensitiveParameter]
1817
public string $projectId,
1918
/** @var non-empty-string */
19+
#[\SensitiveParameter]
2020
public string $clientEmail,
2121
/** @var non-empty-string */
22+
#[\SensitiveParameter]
2223
public string $clientId,
2324
/** @var non-empty-string */
25+
#[\SensitiveParameter]
2426
public string $privateKey,
2527
/** @var non-empty-string */
28+
#[\SensitiveParameter]
2629
public string $privateKeyId,
2730
/** @var non-empty-string */
31+
#[\SensitiveParameter]
2832
public string $authUri,
2933
/** @var non-empty-string */
34+
#[\SensitiveParameter]
3035
public string $tokenUri,
3136
/** @var non-empty-string */
37+
#[\SensitiveParameter]
3238
public string $authProviderX509CertUrl,
3339
/** @var non-empty-string */
40+
#[\SensitiveParameter]
3441
public string $clientX509CertUrl,
3542
/** @var non-empty-string|null */
43+
#[\SensitiveParameter]
3644
public ?string $quotaProjectId = null,
3745
/** @var non-empty-string|null */
46+
#[\SensitiveParameter]
3847
public ?string $universeDomain = null,
3948
) {
4049
}

0 commit comments

Comments
 (0)