kreait / firebase-php

Compare 316bca4 ... +119 ... 7203dc4

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/SignInResult.php Auth/CreateActionLink/GuzzleApiClientHandler.php Auth/CreateActionLink/FailedToCreateActionLink.php Auth/CreateActionLink/ApiRequest.php Auth/SendActionLink/ApiRequest.php Auth/SendActionLink/FailedToSendActionLink.php Auth/SendActionLink/GuzzleApiClientHandler.php Auth/UserRecord.php Auth/SignInWithIdpCredentials.php Auth/CustomTokenViaGoogleIam.php Auth/SendActionLink.php Auth/CreateActionLink.php Auth/SignInWithEmailAndOobCode.php Auth/SignInWithEmailAndPassword.php Auth/UserMetaData.php Auth/SignInWithRefreshToken.php Auth/SignInWithCustomToken.php Auth/UserInfo.php Auth/SignInAnonymously.php Auth/TenantId.php Auth/DisabledLegacyIdTokenVerifier.php Auth/DisabledLegacyCustomTokenGenerator.php Messaging/CloudMessage.php Messaging/AppInstanceApiClient.php Messaging/MulticastSendReport.php Messaging/Notification.php Messaging/ApnsConfig.php Messaging/SendReport.php Messaging/Http/Request/SendMessages.php Messaging/Http/Request/SendMessageToTokens.php Messaging/Http/Request/SendMessage.php Messaging/RegistrationTokens.php Messaging/MessageData.php Messaging/AppInstance.php Messaging/AndroidConfig.php Messaging/MessageTarget.php Messaging/WebPushConfig.php Messaging/Condition.php Messaging/TopicSubscription.php Messaging/Topic.php Messaging/FcmOptions.php Messaging/ApiClient.php Messaging/RegistrationToken.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/Template.php RemoteConfig/FindVersions.php RemoteConfig/ApiClient.php RemoteConfig/Parameter.php RemoteConfig/Condition.php RemoteConfig/Version.php RemoteConfig/ParameterGroup.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 Auth.php Factory.php Exception/MessagingApiExceptionConverter.php Exception/Messaging/ServerUnavailable.php Exception/Messaging/QuotaExceeded.php Exception/Messaging/NotFound.php Exception/Messaging/AuthenticationError.php Exception/Messaging/InvalidMessage.php Exception/Messaging/MessagingError.php Exception/Messaging/ServerError.php Exception/AuthApiExceptionConverter.php Exception/Database/TransactionFailed.php Exception/Database/DatabaseNotFound.php Exception/Database/ReferenceHasNotBeenSnapshotted.php Exception/Database/UnsupportedQuery.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 74 of 167 files from the diff.
Other files ignored by Codecov
.editorconfig has changed.
phpunit.xml.dist has changed.
CHANGELOG.md has changed.
README.md has changed.
.php_cs.dist has changed.
Makefile has changed.
phpstan.neon.dist has changed.
.github/lock.yml was deleted.
docs/conf.py has changed.
composer.json has changed.
docs/setup.rst has changed.
docs/overview.rst has changed.
.gitattributes has changed.
docs/index.rst has changed.

@@ -15,6 +15,17 @@
Loading
15 15
    /** @var DateTimeImmutable|null */
16 16
    public $lastLoginAt;
17 17
18 +
    /** @var DateTimeImmutable|null */
19 +
    public $passwordUpdatedAt;
20 +
21 +
    /**
22 +
     * The time at which the user was last active (ID token refreshed), or null
23 +
     * if the user was never active.
24 +
     *
25 +
     * @var DateTimeImmutable|null
26 +
     */
27 +
    public $lastRefreshAt;
28 +
18 29
    /**
19 30
     * @param array<string, mixed> $data
20 31
     */
@@ -27,6 +38,14 @@
Loading
27 38
            $metadata->lastLoginAt = DT::toUTCDateTimeImmutable($data['lastLoginAt']);
28 39
        }
29 40
41 +
        if ($data['passwordUpdatedAt'] ?? null) {
42 +
            $metadata->passwordUpdatedAt = DT::toUTCDateTimeImmutable($data['passwordUpdatedAt']);
43 +
        }
44 +
45 +
        if ($data['lastRefreshAt'] ?? null) {
46 +
            $metadata->lastRefreshAt = DT::toUTCDateTimeImmutable($data['lastRefreshAt']);
47 +
        }
48 +
30 49
        return $metadata;
31 50
    }
32 51

@@ -5,25 +5,33 @@
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;
13 12
14 -
final class SendMessage implements RequestInterface
13 +
final class SendMessage implements MessageRequest, RequestInterface
15 14
{
16 15
    use WrappedPsr7Request;
17 16
18 -
    public function __construct(string $projectId, Message $message)
17 +
    /** @var Message */
18 +
    private $message;
19 +
20 +
    public function __construct(string $projectId, Message $message, bool $validateOnly = false)
19 21
    {
20 -
        $uri = uri_for('https://fcm.googleapis.com/v1/projects/'.$projectId.'/messages:send');
21 -
        $body = stream_for(\json_encode(['message' => $message]));
22 +
        $uri = Utils::uriFor('https://fcm.googleapis.com/v1/projects/'.$projectId.'/messages:send');
23 +
        $body = Utils::streamFor(\json_encode(['message' => $message, 'validate_only' => $validateOnly]));
22 24
        $headers = [
23 25
            'Content-Type' => 'application/json; charset=UTF-8',
24 26
            'Content-Length' => $body->getSize(),
25 27
        ];
26 28
27 29
        $this->wrappedRequest = new Request('POST', $uri, $headers, $body);
30 +
        $this->message = $message;
31 +
    }
32 +
33 +
    public function message(): Message
34 +
    {
35 +
        return $this->message;
28 36
    }
29 37
}

@@ -4,14 +4,17 @@
Loading
4 4
5 5
namespace Kreait\Firebase\Auth;
6 6
7 -
final class SignInWithEmailAndOobCode implements SignIn
7 +
final class SignInWithEmailAndOobCode implements IsTenantAware, SignIn
8 8
{
9 9
    /** @var string */
10 10
    private $email;
11 11
12 12
    /** @var string */
13 13
    private $oobCode;
14 14
15 +
    /** @var TenantId|null */
16 +
    private $tenantId;
17 +
15 18
    private function __construct()
16 19
    {
17 20
    }
@@ -25,6 +28,14 @@
Loading
25 28
        return $instance;
26 29
    }
27 30
31 +
    public function withTenantId(TenantId $tenantId): self
32 +
    {
33 +
        $action = clone $this;
34 +
        $action->tenantId = $tenantId;
35 +
36 +
        return $action;
37 +
    }
38 +
28 39
    public function email(): string
29 40
    {
30 41
        return $this->email;
@@ -34,4 +45,9 @@
Loading
34 45
    {
35 46
        return $this->oobCode;
36 47
    }
48 +
49 +
    public function tenantId(): ?TenantId
50 +
    {
51 +
        return $this->tenantId;
52 +
    }
37 53
}

@@ -5,7 +5,7 @@
Loading
5 5
namespace Kreait\Firebase\DynamicLink\GetStatisticsForDynamicLink;
6 6
7 7
use GuzzleHttp\Psr7\Request;
8 -
use function GuzzleHttp\Psr7\uri_for;
8 +
use GuzzleHttp\Psr7\Utils;
9 9
use Kreait\Firebase\DynamicLink\GetStatisticsForDynamicLink;
10 10
use Kreait\Firebase\Http\WrappedPsr7Request;
11 11
use Psr\Http\Message\RequestInterface;
@@ -18,7 +18,7 @@
Loading
18 18
    {
19 19
        $link = \rawurlencode($action->dynamicLink());
20 20
21 -
        $uri = uri_for('https://firebasedynamiclinks.googleapis.com/v1/'.$link.'/linkStats?durationDays='.$action->durationInDays());
21 +
        $uri = Utils::uriFor('https://firebasedynamiclinks.googleapis.com/v1/'.$link.'/linkStats?durationDays='.$action->durationInDays());
22 22
23 23
        $headers = [
24 24
            'Content-Type' => 'application/json; charset=UTF-8',

@@ -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
    /**

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...

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...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 26 files with coverage changes found.

Changes in src/Firebase/Auth/SendActionLink/FailedToSendActionLink.php
-6
+6
Loading file...
Changes in src/Firebase/Auth/CreateActionLink/FailedToCreateActionLink.php
-6
+6
Loading file...
Changes in src/Firebase/Database/ApiClient.php
-19
+19
Loading file...
Changes in src/Firebase/Database/RuleSet.php
-8
+8
Loading file...
Changes in src/Firebase/Auth/CreateActionLink/GuzzleApiClientHandler.php
-5
+5
Loading file...
Changes in src/Firebase/Auth/IdTokenVerifier.php
-15
+15
Loading file...
Changes in src/Firebase/Messaging/AppInstance.php
-6
+6
Loading file...
Changes in src/Firebase/Auth/SendActionLink/GuzzleApiClientHandler.php
-2
+2
Loading file...
Changes in src/Firebase/Database/Transaction.php
-5
+5
Loading file...
Changes in src/Firebase/Messaging/TopicSubscription.php
-2
+2
Loading file...
Changes in src/Firebase/Exception/Database/TransactionFailed.php
-1
+1
Loading file...
Changes in src/Firebase/Database.php
-1
+1
Loading file...
Changes in src/Firebase/Auth.php
-4
+4
Loading file...
Changes in src/Firebase/Database/Reference.php
-1
+1
Loading file...
Changes in src/Firebase/RemoteConfig/Parameter.php
-10
Loading file...
New file src/Firebase/Http/HttpClientOptions.php
New
Loading file...
New file src/Firebase/Exception/Database/DatabaseNotFound.php
New
Loading file...
New file src/Firebase/RemoteConfig/ParameterGroup.php
New
Loading file...
New file src/Firebase/Auth/TenantId.php
New
Loading file...
New file src/Firebase/Exception/Messaging/QuotaExceeded.php
New
Loading file...
Changes in src/Firebase/RemoteConfig/Template.php
-3
-1
Loading file...
Changes in src/Firebase/Messaging/MulticastSendReport.php
-3
+1
Loading file...
Changes in src/Firebase/RemoteConfig/Version.php
-2
+2
Loading file...
Changes in src/Firebase/Messaging/SendReport.php
-2
+2
Loading file...
Changes in src/Firebase/Http/ErrorResponseParser.php
-2
+2
Loading file...
Changes in src/Firebase/RemoteConfig/UpdateOrigin.php
-2
+2
Loading file...

121 Commits

+2
+2
Hiding 1 contexual commits
+1
+1
-40
+40
+2
+2
+1
-1
Hiding 1 contexual commits
+43
+44
-1
-7
+7
+11
+18
-7
Hiding 1 contexual commits
+10
+10
+12
+11
+1
-1 Files
-71
-59
-12
Hiding 2 contexual commits
Hiding 2 contexual commits
-7
-1
-6
-20
+20
+1273
-1273
-1273
+1273
+3
+4
-1
-1 Files
+5
-5
+2 Files
+89
+15
+74
+1 Files
+88
+56
+32
+2
+1037
-1035
-1036
+1036
Hiding 1 contexual commits
-2
-2
Hiding 1 contexual commits
+8
+1
+7
-6
+1
-7
+8
+1
+7
-2
-8
+6
+1 Files
+32
+37
-5
+30
+30
+1035
-1035
-1035
+1035
+7
+8
-1
Hiding 1 contexual commits
+1 Files
+35
+43
-8
+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 ø -4.30% 91.65%
Project Totals (150 files) 1581 91.65%
Loading