From e280263758c734d231208c79ee7f372803ee9149 Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Tue, 29 Jun 2021 16:56:28 -0400 Subject: [PATCH 01/12] add Identity Platform --- src/Facades/FirebaseIdentityPlatform.php | 19 +++++++++++++++++++ src/FirebaseProject.php | 10 ++++++++++ src/ServiceProvider.php | 5 +++++ 3 files changed, 34 insertions(+) create mode 100644 src/Facades/FirebaseIdentityPlatform.php diff --git a/src/Facades/FirebaseIdentityPlatform.php b/src/Facades/FirebaseIdentityPlatform.php new file mode 100644 index 0000000..39b5e6f --- /dev/null +++ b/src/Facades/FirebaseIdentityPlatform.php @@ -0,0 +1,19 @@ +auth; } + public function identityPlatform(): Firebase\IdentityPlatform + { + if (!$this->auth) { + $this->auth = $this->factory->createIdentityPlatform(); + } + + return $this->auth; + } + + public function database(): Firebase\Contract\Database { if (!$this->database) { diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 701c4c6..4dc50cd 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -78,6 +78,11 @@ private function registerComponents(): void return $app->make(FirebaseProjectManager::class)->project()->storage(); }); $this->app->alias(Firebase\Storage::class, 'firebase.storage'); + + $this->app->singleton(Firebase\IdentityPlatform::class, static function (Container $app) { + return $app->make(FirebaseProjectManager::class)->project()->identityPlatform(); + }); + $this->app->alias(Firebase\IdentityPlatform::class, 'firebase.identity_platform'); } private function registerManager(): void From b7868cdd22248f4e824f88e98eabcb68d4050488 Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Tue, 29 Jun 2021 17:13:43 -0400 Subject: [PATCH 02/12] test composer --- composer.json | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index a8582f1..64466ac 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,12 @@ { "name": "kreait/laravel-firebase", "description": "A Laravel package for the Firebase PHP Admin SDK", - "keywords": ["laravel", "firebase", "fcm", "gcm"], + "keywords": [ + "laravel", + "firebase", + "fcm", + "gcm" + ], "type": "library", "license": "MIT", "authors": [ @@ -12,7 +17,7 @@ ], "require": { "php": "^7.2|~8.0.0", - "kreait/firebase-php": "^5.18", + "kreait/firebase-php": "dev-add-identity-platform", "illuminate/contracts": "^6.0|^7.0|^8.0", "illuminate/support": "^6.0|^7.0|^8.0" }, @@ -42,6 +47,7 @@ "aliases": { "Firebase": "Kreait\\Laravel\\Firebase\\Facades\\Firebase", "FirebaseAuth": "Kreait\\Laravel\\Firebase\\Facades\\FirebaseAuth", + "FirebaseIdentityPlatform": "Kreait\\Laravel\\Firebase\\Facades\\FirebaseIdentityPlatform", "FirebaseDatabase": "Kreait\\Laravel\\Firebase\\Facades\\FirebaseDatabase", "FirebaseDynamicLinks": "Kreait\\Laravel\\Firebase\\Facades\\FirebaseDynamicLinks", "FirebaseFirestore": "Kreait\\Laravel\\Firebase\\Facades\\FirebaseFirestore", @@ -50,5 +56,11 @@ "FirebaseStorage": "Kreait\\Laravel\\Firebase\\Facades\\FirebaseStorage" } } - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/Cybrary/firebase-php" + } + ] } From 7945d14776c212e8835e8168fdb9b5373494bc27 Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Fri, 13 Aug 2021 18:50:14 -0400 Subject: [PATCH 03/12] change name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 64466ac..d99c1f2 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "kreait/laravel-firebase", + "name": "Cybrary/laravel-firebase", "description": "A Laravel package for the Firebase PHP Admin SDK", "keywords": [ "laravel", From 9dffbf3744bb118d98f1e2de32256e2b2b80e80b Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Fri, 13 Aug 2021 18:52:14 -0400 Subject: [PATCH 04/12] change name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d99c1f2..d5c8309 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "Cybrary/laravel-firebase", + "name": "cybrary/laravel-firebase", "description": "A Laravel package for the Firebase PHP Admin SDK", "keywords": [ "laravel", From 5a0bd10af38a414471d458fc468302ea0c3c4b2f Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Fri, 13 Aug 2021 19:04:39 -0400 Subject: [PATCH 05/12] specify version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d5c8309..4e64661 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^7.2|~8.0.0", - "kreait/firebase-php": "dev-add-identity-platform", + "kreait/firebase-php": "^6.0", "illuminate/contracts": "^6.0|^7.0|^8.0", "illuminate/support": "^6.0|^7.0|^8.0" }, From 2105956dcbcfa307a5d9f88601570482709592aa Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Fri, 3 Sep 2021 16:03:29 -0400 Subject: [PATCH 06/12] use separate var for identity platform --- src/FirebaseProject.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/FirebaseProject.php b/src/FirebaseProject.php index 7d69a56..3c27cb4 100644 --- a/src/FirebaseProject.php +++ b/src/FirebaseProject.php @@ -26,6 +26,9 @@ class FirebaseProject /** @var \Kreait\Firebase\Contract\Firestore|null */ protected $firestore; + /** @var \Kreait\Firebase\Contract\IdentityPlatform|null */ + protected $identityPlatform; + /** @var \Kreait\Firebase\Contract\Messaging|null */ protected $messaging; @@ -53,10 +56,10 @@ public function auth(): Firebase\Contract\Auth public function identityPlatform(): Firebase\IdentityPlatform { if (!$this->auth) { - $this->auth = $this->factory->createIdentityPlatform(); + $this->identityPlatform = $this->factory->createIdentityPlatform(); } - return $this->auth; + return $this->identityPlatform; } From 1ab70d3bbd7190e3381397608a9483fee2053e40 Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Fri, 3 Sep 2021 16:04:39 -0400 Subject: [PATCH 07/12] use separate var for identity platform --- src/FirebaseProject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FirebaseProject.php b/src/FirebaseProject.php index 3c27cb4..32840fd 100644 --- a/src/FirebaseProject.php +++ b/src/FirebaseProject.php @@ -55,7 +55,7 @@ public function auth(): Firebase\Contract\Auth public function identityPlatform(): Firebase\IdentityPlatform { - if (!$this->auth) { + if (!$this->identityPlatform) { $this->identityPlatform = $this->factory->createIdentityPlatform(); } From 65d7f945d97644720e2343e30461546a2cdc7377 Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Wed, 15 Sep 2021 14:22:46 -0400 Subject: [PATCH 08/12] set default log channel --- src/FirebaseProjectManager.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/FirebaseProjectManager.php b/src/FirebaseProjectManager.php index 9c33d80..217fc1f 100644 --- a/src/FirebaseProjectManager.php +++ b/src/FirebaseProjectManager.php @@ -83,9 +83,15 @@ protected function configure(string $name): FirebaseProject if ($defaultStorageBucket = $config['storage']['default_bucket'] ?? null) { $factory = $factory->withDefaultStorageBucket($defaultStorageBucket); } + if ($logChannel = $config['logging']['http_debug_log_channel'] ?? null) { + $factory = $factory->withHttpDebugLogger( + $this->app->make('log')->channel($logChannel) + ); + } if ($config['debug'] ?? false) { - $factory = $factory->withEnabledDebug(); + $logger = $this->app->make('log')->channel($logChannel ?? null); + $factory = $factory->withEnabledDebug($logger); } if ($cacheStore = $config['cache_store'] ?? null) { @@ -100,11 +106,7 @@ protected function configure(string $name): FirebaseProject ); } - if ($logChannel = $config['logging']['http_debug_log_channel'] ?? null) { - $factory = $factory->withHttpDebugLogger( - $this->app->make('log')->channel($logChannel) - ); - } + $options = HttpClientOptions::default(); From 0e488f64b6a8dd8ef3acafaa7e7b8811302435e2 Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Thu, 17 Feb 2022 12:37:00 -0500 Subject: [PATCH 09/12] use php 8.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4e64661..8f2fd00 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^7.2|~8.0.0", + "php": "^7.2|~8.0.0| ^8.1", "kreait/firebase-php": "^6.0", "illuminate/contracts": "^6.0|^7.0|^8.0", "illuminate/support": "^6.0|^7.0|^8.0" From ad6d62f735ac967e31308c7ec1eeedce9c776897 Mon Sep 17 00:00:00 2001 From: Petr Arapov Date: Thu, 17 Feb 2022 13:45:37 -0500 Subject: [PATCH 10/12] add laravel 9 support --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 8f2fd00..a5ff8bb 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,8 @@ "require": { "php": "^7.2|~8.0.0| ^8.1", "kreait/firebase-php": "^6.0", - "illuminate/contracts": "^6.0|^7.0|^8.0", - "illuminate/support": "^6.0|^7.0|^8.0" + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0" }, "require-dev": { "orchestra/testbench": "^4.0|^5.0|^6.0", From 3ced340b4922474b8d1521c37e4b54e6f7c77185 Mon Sep 17 00:00:00 2001 From: Benjamin Matics Date: Mon, 13 Jan 2025 09:40:08 -0500 Subject: [PATCH 11/12] revert workflow --- .github/workflows/dependabot-auto-merge.yml | 23 --------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml deleted file mode 100644 index 5958175..0000000 --- a/.github/workflows/dependabot-auto-merge.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Dependabot auto-merge" - -on: [pull_request_target] # yamllint disable-line rule:truthy - -permissions: - contents: "write" - -jobs: - dependabot: - runs-on: "ubuntu-latest" - if: "${{ github.actor == 'dependabot[bot]' }}" - steps: - - name: "Dependabot metadata" - id: "metadata" - uses: "dependabot/fetch-metadata@v2.2.0" - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: "Enable auto-merge for Dependabot PRs" - if: "${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}" - run: "gh pr merge --auto --merge \"$PR_URL\"" - env: - PR_URL: "${{github.event.pull_request.html_url}}" - GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}" From 91937295cd4c1f47bf947d1ae0a0c49c742872cd Mon Sep 17 00:00:00 2001 From: Benjamin Matics Date: Mon, 13 Jan 2025 09:40:51 -0500 Subject: [PATCH 12/12] revert workflow --- .github/workflows/tests.yml | 118 +++++++++++++++++------------------- 1 file changed, 55 insertions(+), 63 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 72f4724..f657e1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,68 +1,60 @@ name: Tests on: - pull_request: - paths: - - 'config/**' - - 'src/**' - - 'tests/**' - - '.github/workflows/tests.yml' - - 'composer.json' - push: - branches: ['main'] - paths: - - 'config/**' - - 'src/**' - - 'tests/**' - - '.github/workflows/tests.yml' - - 'composer.json' - workflow_dispatch: + push: + pull_request: jobs: - test: - name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - runs-on: 'ubuntu-latest' - - strategy: - matrix: - php: - - "8.1" - - "8.2" - - "8.3" - - "8.4" - laravel: - - "9" - - "10" - - "11" - exclude: - - php: "8.1" - laravel: "11" - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: ctype, dom, grpc, json, mbstring, openssl, xml, zip, zlib - coverage: xdebug - - - name: Install dependencies - run: | - composer require -W "illuminate/contracts:^${{ matrix.laravel }}.0" - composer require -W --dev orchestra/testbench - - - name: Setup Problem Matchers - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Run PHPUnit - run: vendor/bin/phpunit --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox - - - name: Upload code coverage - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} + test: + runs-on: 'ubuntu-latest' + strategy: + fail-fast: false + matrix: + php: ['7.4'] + laravel: ['6.0', '7.0', '8.0'] + include: + - laravel: '8.0' + testbench: '6.0' + - laravel: '7.0' + testbench: '5.2' + - laravel: '6.0' + testbench: '4.8' + + name: Laravel ${{ matrix.laravel }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: ctype, dom, json, mbstring, openssl, xml, zip, zlib + coverage: xdebug + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Install dependencies + run: | + composer require "laravel/framework:^${{ matrix.laravel }}" "orchestra/testbench:^${{ matrix.testbench }}" --no-interaction --no-update + composer update --prefer-dist --no-interaction --no-suggest + + - name: Setup Problem Matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Execute tests + run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml --log-junit=test-report.xml + + - name: Upload code coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }}