kreait / firebase-php

Compare 316bca4 ... +44 ... 7ec990b

Coverage Reach
Auth/SignIn/GuzzleHandler.php Auth/SignIn/FailedToSignIn.php Auth/ApiClient.php Auth/IdTokenVerifier.php Auth/ActionCodeSettings/ValidatedActionCodeSettings.php Auth/ActionCodeSettings/RawActionCodeSettings.php Auth/CreateActionLink/GuzzleApiClientHandler.php Auth/CreateActionLink/FailedToCreateActionLink.php Auth/CreateActionLink/ApiRequest.php Auth/UserRecord.php Auth/SendActionLink/FailedToSendActionLink.php Auth/SendActionLink/ApiRequest.php Auth/SendActionLink/GuzzleApiClientHandler.php Auth/SignInResult.php Auth/SignInWithIdpCredentials.php Auth/CustomTokenViaGoogleIam.php Auth/SendActionLink.php Auth/CreateActionLink.php Auth/UserMetaData.php Auth/UserInfo.php Auth/SignInWithEmailAndOobCode.php Auth/SignInWithEmailAndPassword.php Auth/SignInWithRefreshToken.php Auth/SignInWithCustomToken.php Auth/DisabledLegacyIdTokenVerifier.php Auth/DisabledLegacyCustomTokenGenerator.php Auth/SignInAnonymously.php Messaging/AppInstanceApiClient.php Messaging/CloudMessage.php Messaging/MulticastSendReport.php Messaging/Notification.php Messaging/Http/Request/SendMessages.php Messaging/Http/Request/SendMessageToTokens.php Messaging/Http/Request/ValidateMessage.php Messaging/Http/Request/SendMessage.php Messaging/RegistrationTokens.php Messaging/SendReport.php Messaging/AppInstance.php Messaging/MessageTarget.php Messaging/MessageData.php Messaging/Condition.php Messaging/TopicSubscription.php Messaging/Topic.php Messaging/FcmOptions.php Messaging/ApiClient.php Messaging/RegistrationToken.php Messaging/ApnsConfig.php Messaging/AndroidConfig.php Messaging/WebPushConfig.php Messaging/TopicSubscriptions.php Messaging/Messages.php Messaging/RawMessageFromArray.php DynamicLink/AnalyticsInfo/GooglePlayAnalytics.php DynamicLink/AnalyticsInfo/ITunesConnectAnalytics.php DynamicLink/CreateDynamicLink.php DynamicLink/IOSInfo.php DynamicLink/EventStatistics.php DynamicLink/CreateDynamicLink/FailedToCreateDynamicLink.php DynamicLink/CreateDynamicLink/GuzzleApiClientHandler.php DynamicLink/CreateDynamicLink/ApiRequest.php DynamicLink/ShortenLongDynamicLink/FailedToShortenLongDynamicLink.php DynamicLink/ShortenLongDynamicLink/GuzzleApiClientHandler.php DynamicLink/ShortenLongDynamicLink/ApiRequest.php DynamicLink/GetStatisticsForDynamicLink/GuzzleApiClientHandler.php DynamicLink/GetStatisticsForDynamicLink/FailedToGetStatisticsForDynamicLink.php DynamicLink/GetStatisticsForDynamicLink/ApiRequest.php DynamicLink/SocialMetaTagInfo.php DynamicLink/AndroidInfo.php DynamicLink/ShortenLongDynamicLink.php DynamicLink/AnalyticsInfo.php DynamicLink/NavigationInfo.php DynamicLink/GetStatisticsForDynamicLink.php DynamicLink/DynamicLinkStatistics.php RemoteConfig/Parameter.php RemoteConfig/Template.php RemoteConfig/FindVersions.php RemoteConfig/ApiClient.php RemoteConfig/Version.php RemoteConfig/Condition.php RemoteConfig/ConditionalValue.php RemoteConfig/VersionNumber.php RemoteConfig/DefaultValue.php RemoteConfig/User.php RemoteConfig/TagColor.php RemoteConfig/UpdateType.php RemoteConfig/UpdateOrigin.php Database/Reference.php Database/Query/Filter/EndAt.php Database/Query/Filter/EqualTo.php Database/Query/Filter/StartAt.php Database/Query/Filter/LimitToLast.php Database/Query/Filter/LimitToFirst.php Database/Query/Filter/Shallow.php Database/Query/Sorter/OrderByChild.php Database/Query/Sorter/OrderByKey.php Database/Query/Sorter/OrderByValue.php Database/Query.php Database/ApiClient.php Database/Reference/Validator.php Database/Snapshot.php Database/Transaction.php Database/RuleSet.php Factory.php Auth.php Exception/AuthApiExceptionConverter.php Exception/MessagingApiExceptionConverter.php Exception/Database/TransactionFailed.php Exception/Database/ReferenceHasNotBeenSnapshotted.php Exception/Database/UnsupportedQuery.php Exception/Messaging/ServerUnavailable.php Exception/Messaging/AuthenticationError.php Exception/Messaging/InvalidMessage.php Exception/Messaging/MessagingError.php Exception/Messaging/NotFound.php Exception/Messaging/ServerError.php Exception/RemoteConfigApiExceptionConverter.php Exception/DatabaseApiExceptionConverter.php Exception/Auth/RevokedIdToken.php Exception/RemoteConfig/VersionNotFound.php Http/ResponseWithSubResponses.php Http/HttpClientOptions.php Http/Middleware.php Http/RequestWithSubRequests.php Http/ErrorResponseParser.php Http/Requests.php Http/Responses.php Request/UpdateUser.php Request/CreateUser.php Messaging.php Value/Url.php Value/PhoneNumber.php Value/Email.php Value/ClearTextPassword.php Value/Uid.php Value/Provider.php DynamicLinks.php Util/DT.php Util/JSON.php Util/Deprecation.php ServiceAccount.php RemoteConfig.php Database.php DynamicLink.php Storage.php Project/ProjectId.php Firestore.php Util.php

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 38 of 81 files from the diff.
Other files ignored by Codecov
Makefile has changed.
phpstan.neon.dist has changed.
CHANGELOG.md has changed.
README.md has changed.
composer.json has changed.
docs/setup.rst has changed.
.gitattributes has changed.

@@ -15,6 +15,9 @@
Loading
15 15
    /** @var DateTimeImmutable|null */
16 16
    public $lastLoginAt;
17 17
18 +
    /** @var DateTimeImmutable|null */
19 +
    public $passwordUpdatedAt;
20 +
18 21
    /**
19 22
     * @param array<string, mixed> $data
20 23
     */
@@ -27,6 +30,10 @@
Loading
27 30
            $metadata->lastLoginAt = DT::toUTCDateTimeImmutable($data['lastLoginAt']);
28 31
        }
29 32
33 +
        if ($data['passwordUpdatedAt'] ?? null) {
34 +
            $metadata->passwordUpdatedAt = DT::toUTCDateTimeImmutable($data['passwordUpdatedAt']);
35 +
        }
36 +
30 37
        return $metadata;
31 38
    }
32 39

@@ -5,8 +5,7 @@
Loading
5 5
namespace Kreait\Firebase\Messaging\Http\Request;
6 6
7 7
use GuzzleHttp\Psr7\Request;
8 -
use function GuzzleHttp\Psr7\stream_for;
9 -
use function GuzzleHttp\Psr7\uri_for;
8 +
use GuzzleHttp\Psr7\Utils;
10 9
use Kreait\Firebase\Http\WrappedPsr7Request;
11 10
use Kreait\Firebase\Messaging\Message;
12 11
use Psr\Http\Message\RequestInterface;
@@ -17,8 +16,8 @@
Loading
17 16
18 17
    public function __construct(string $projectId, Message $message)
19 18
    {
20 -
        $uri = uri_for('https://fcm.googleapis.com/v1/projects/'.$projectId.'/messages:send');
21 -
        $body = stream_for(\json_encode(['message' => $message]));
19 +
        $uri = Utils::uriFor('https://fcm.googleapis.com/v1/projects/'.$projectId.'/messages:send');
20 +
        $body = Utils::streamFor(\json_encode(['message' => $message]));
22 21
        $headers = [
23 22
            'Content-Type' => 'application/json; charset=UTF-8',
24 23
            'Content-Length' => $body->getSize(),

@@ -36,7 +36,10 @@
Loading
36 36
    /** @var array<int, array<string, string>> */
37 37
    private $events;
38 38
39 -
    private function __construct(array ...$events)
39 +
    /**
40 +
     * @param array<int, array<string, string>> $events
41 +
     */
42 +
    private function __construct(array $events)
40 43
    {
41 44
        $this->events = $events;
42 45
    }
@@ -46,7 +49,7 @@
Loading
46 49
     */
47 50
    public static function fromArray(array $events): self
48 51
    {
49 -
        return new self(...$events);
52 +
        return new self($events);
50 53
    }
51 54
52 55
    public function onAndroid(): self
@@ -105,7 +108,7 @@
Loading
105 108
106 109
    public function filter(callable $filter): self
107 110
    {
108 -
        return new self(...\array_filter($this->events, $filter));
111 +
        return new self(\array_filter($this->events, $filter));
109 112
    }
110 113
111 114
    /**

@@ -13,6 +13,7 @@
Loading
13 13
{
14 14
    public const DISPLAY_NAME = 'DISPLAY_NAME';
15 15
    public const PHOTO_URL = 'PHOTO_URL';
16 +
    public const EMAIL = 'EMAIL';
16 17
17 18
    use EditUserTrait;
18 19
@@ -55,6 +56,10 @@
Loading
55 56
                case 'removedisplayname':
56 57
                    $request = $request->withRemovedDisplayName();
57 58
                    break;
59 +
                case 'deleteemail':
60 +
                case 'removeemail':
61 +
                    $request = $request->withRemovedEmail();
62 +
                    break;
58 63
59 64
                case 'deleteattribute':
60 65
                case 'deleteattributes':
@@ -67,6 +72,9 @@
Loading
67 72
                            case 'photourl':
68 73
                                $request = $request->withRemovedPhotoUrl();
69 74
                                break;
75 +
                            case 'email':
76 +
                                $request = $request->withRemovedEmail();
77 +
                                break;
70 78
                        }
71 79
                    }
72 80
                    break;
@@ -139,6 +147,15 @@
Loading
139 147
        return $request;
140 148
    }
141 149
150 +
    public function withRemovedEmail(): self
151 +
    {
152 +
        $request = clone $this;
153 +
        $request->email = null;
154 +
        $request->attributesToDelete[] = self::EMAIL;
155 +
156 +
        return $request;
157 +
    }
158 +
142 159
    /**
143 160
     * @param array<string, mixed> $customAttributes
144 161
     */

@@ -5,8 +5,7 @@
Loading
5 5
namespace Kreait\Firebase\Messaging\Http\Request;
6 6
7 7
use GuzzleHttp\Psr7\Request;
8 -
use function GuzzleHttp\Psr7\stream_for;
9 -
use function GuzzleHttp\Psr7\uri_for;
8 +
use GuzzleHttp\Psr7\Utils;
10 9
use Kreait\Firebase\Http\WrappedPsr7Request;
11 10
use Kreait\Firebase\Messaging\Message;
12 11
use Psr\Http\Message\RequestInterface;
@@ -17,8 +16,8 @@
Loading
17 16
18 17
    public function __construct(string $projectId, Message $message)
19 18
    {
20 -
        $uri = uri_for('https://fcm.googleapis.com/v1/projects/'.$projectId.'/messages:send');
21 -
        $body = stream_for(\json_encode(['message' => $message, 'validate_only' => true]));
19 +
        $uri = Utils::uriFor('https://fcm.googleapis.com/v1/projects/'.$projectId.'/messages:send');
20 +
        $body = Utils::streamFor(\json_encode(['message' => $message, 'validate_only' => true]));
22 21
        $headers = [
23 22
            'Content-Type' => 'application/json; charset=UTF-8',
24 23
            'Content-Length' => $body->getSize(),

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 62 files with coverage changes found.

Changes in src/Firebase/Http/Responses.php
-2
+2
Loading file...
Changes in src/Firebase/Auth/SignInWithEmailAndOobCode.php
-10
+10
Loading file...
Changes in src/Firebase/RemoteConfig.php
-39
+39
Loading file...
Changes in src/Firebase/Auth/SignInWithCustomToken.php
-7
+7
Loading file...
Changes in src/Firebase/Auth/SignInWithEmailAndPassword.php
-10
+10
Loading file...
Changes in src/Firebase/Exception/RemoteConfig/VersionNotFound.php
-2
+2
Loading file...
Changes in src/Firebase/Auth/SignInWithRefreshToken.php
-7
+7
Loading file...
Changes in src/Firebase/Http/Requests.php
-5
+5
Loading file...
Changes in src/Firebase/Messaging/RawMessageFromArray.php
-4
+4
Loading file...
Changes in src/Firebase/Messaging/TopicSubscriptions.php
-6
+6
Loading file...
Changes in src/Firebase/Messaging/AppInstance.php
-26
+26
Loading file...
Changes in src/Firebase/Firestore.php
-7
+7
Loading file...
Changes in src/Firebase/RemoteConfig/FindVersions.php
-45
+45
Loading file...
Changes in src/Firebase/Messaging/SendReport.php
-26
+26
Loading file...
Changes in src/Firebase/Http/RequestWithSubRequests.php
-28
+28
Loading file...
Changes in src/Firebase/Messaging/MulticastSendReport.php
-58
+58
Loading file...
Changes in src/Firebase/Http/ResponseWithSubResponses.php
-30
+30
Loading file...
Changes in src/Firebase/RemoteConfig/VersionNumber.php
-11
+11
Loading file...
Changes in src/Firebase/Auth/UserRecord.php
-28
+28
Loading file...
Changes in src/Firebase/Messaging/Http/Request/SendMessages.php
-10
+10
Loading file...
Changes in src/Firebase/Auth/CustomTokenViaGoogleIam.php
-21
+21
Loading file...
Changes in src/Firebase/RemoteConfig/Version.php
-23
+23
Loading file...
Changes in src/Firebase/Auth/SignInWithIdpCredentials.php
-17
+17
Loading file...
Changes in src/Firebase/RemoteConfig/ApiClient.php
-31
+31
Loading file...
Changes in src/Firebase/Messaging/Http/Request/SendMessageToTokens.php
-7
+7
Loading file...
Changes in src/Firebase/Auth.php
-138
+138
Loading file...
Changes in src/Firebase/RemoteConfig/UpdateType.php
-7
+7
Loading file...
Changes in src/Firebase/Messaging/TopicSubscription.php
-8
+8
Loading file...
Changes in src/Firebase/RemoteConfig/Parameter.php
-28
+28
Loading file...
Changes in src/Firebase/Auth/ApiClient.php
-28
+28
Loading file...
Changes in src/Firebase/RemoteConfig/User.php
-7
+7
Loading file...
Changes in src/Firebase/RemoteConfig/UpdateOrigin.php
-5
+5
Loading file...
Changes in src/Firebase/Database/ApiClient.php
-19
+19
Loading file...
Changes in src/Firebase/RemoteConfig/Template.php
-19
+19
Loading file...
Changes in src/Firebase/Http/Middleware.php
-7
+7
Loading file...
Changes in src/Firebase/Database/RuleSet.php
-8
+8
Loading file...
Changes in src/Firebase/Auth/UserMetaData.php
-4
+4
Loading file...
Changes in src/Firebase/Messaging/CloudMessage.php
-20
+20
Loading file...
Changes in src/Firebase/DynamicLink/GetStatisticsForDynamicLink.php
-4
+4
Loading file...
Changes in src/Firebase/Auth/SendActionLink.php
-5
+5
Loading file...
Changes in src/Firebase/Messaging/MessageTarget.php
-6
+6
Loading file...
Changes in src/Firebase/Database/Transaction.php
-5
+5
Loading file...
Changes in src/Firebase/Auth/SignIn/GuzzleHandler.php
-14
+14
Loading file...
Changes in src/Firebase/Util/Deprecation.php
-1
+1
Loading file...
Changes in src/Firebase/DynamicLink/ShortenLongDynamicLink.php
-4
+4
Loading file...
Changes in src/Firebase/Messaging/AppInstanceApiClient.php
-3
+3
Loading file...
Changes in src/Firebase/Messaging/FcmOptions.php
-2
+2
Loading file...
Changes in src/Firebase/Database.php
-4
+4
Loading file...
Changes in src/Firebase/Storage.php
-2
+2
Loading file...
Changes in src/Firebase/Messaging/Topic.php
-2
+2
Loading file...
Changes in src/Firebase/DynamicLink/CreateDynamicLink.php
-8
+8
Loading file...
Changes in src/Firebase/Messaging/Condition.php
-2
+2
Loading file...
Changes in src/Firebase/DynamicLinks.php
-7
+7
Loading file...
Changes in src/Firebase/Messaging.php
-8
+8
Loading file...
Changes in src/Firebase/Exception/RemoteConfigApiExceptionConverter.php
-2
+2
Loading file...
Changes in src/Firebase/Factory.php
-17
+17
Loading file...
Changes in src/Firebase/Exception/Database/TransactionFailed.php
-1
+1
Loading file...
Changes in src/Firebase/Exception/DatabaseApiExceptionConverter.php
-1
+1
Loading file...
Changes in src/Firebase/Exception/MessagingApiExceptionConverter.php
-1
+1
Loading file...
Changes in src/Firebase/Request/UpdateUser.php
-2
+2
Loading file...
Changes in src/Firebase/Database/Reference.php
-1
+1
Loading file...
New file src/Firebase/Http/HttpClientOptions.php
New
Loading file...

46 Commits

+13
-1029
+1042
+85
+56
+29
+6
+4
+2
+10
+10
Hiding 2 contexual commits
+11
+10
+1
+6
+998
-992
-6
-998
+992
+6
+1
+5
-4
-2
-2
+1 Files
+43
+42
+1
+6
+968
-962
Hiding 1 contexual commits
+6
-956
+962
Hiding 3 contexual commits
+2
+2
Hiding 1 contexual commits
+12
+2
+10
Hiding 1 contexual commits
-6
-1
-5
+2
+2
+6
+6
+32
+33
-1
Files Complexity Coverage
src/Firebase ø -30.93% 65.02%
Project Totals (147 files) 1447 65.02%
Loading