Skip to content

Commit ee11e3e

Browse files
committed
Upgrade dependencies
1 parent 9f9aa5b commit ee11e3e

4 files changed

+24
-90
lines changed

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
## Unreleased
44

5-
* Dropped support for Lumen
5+
* Upgraded `kreait/firebase-php` from 6.x to 7.x
6+
* Dropped support for PHP <8.1, Laravel <9.0
7+
* Dropped support for Lumen ([it is not recommended anymore to use it](https://github.com/laravel/lumen/commit/69b26578d2f15595ea901278434b74df459c4329))
68
* The ability to disable credentials auto-discovery has been removed. If you don't want a service account to be
7-
auto-discovered, provide it by setting the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or by adapting
9+
auto-discovered, provide it by setting the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or by modifying
810
the package configuration.
911

1012
## 4.2.0 - 2022-07-28

composer.json

+14-9
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.4 || ^8.0",
15-
"kreait/firebase-php": "^6.7",
16-
"illuminate/contracts": "^8.0 || ^9.0",
17-
"illuminate/support": "^8.0 || ^9.0",
18-
"symfony/cache": "^5.4 || ^6.1.2"
14+
"php": "~8.1.0 || ~8.2.0",
15+
"kreait/firebase-php": "^7.0",
16+
"illuminate/contracts": "^9.0",
17+
"illuminate/support": "^9.0",
18+
"symfony/cache": "^6.1.2"
1919
},
2020
"require-dev": {
21-
"orchestra/testbench": "^6.0 || 7.0",
21+
"orchestra/testbench": "^7.0",
2222
"symplify/easy-coding-standard": "^11.1"
2323
},
2424
"autoload": {
@@ -32,9 +32,6 @@
3232
}
3333
},
3434
"extra": {
35-
"branch-alias": {
36-
"dev-main": "3.x-dev"
37-
},
3835
"laravel": {
3936
"providers": [
4037
"Kreait\\Laravel\\Firebase\\ServiceProvider"
@@ -43,5 +40,13 @@
4340
"Firebase": "Kreait\\Laravel\\Firebase\\Facades\\Firebase"
4441
}
4542
}
43+
},
44+
"scripts": {
45+
"cs": [
46+
"vendor/bin/ecs --fix"
47+
],
48+
"test": [
49+
"vendor/bin/phpunit"
50+
]
4651
}
4752
}

src/FirebaseProjectManager.php

-5
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ protected function configure(string $name): FirebaseProject
7474
$factory = $factory->withServiceAccount($resolvedCredentials);
7575
}
7676

77-
$enableAutoDiscovery = $config['credentials']['auto_discovery'] ?? ($this->getDefaultProject() === $name);
78-
if (!$enableAutoDiscovery) {
79-
$factory = $factory->withDisabledAutoDiscovery();
80-
}
81-
8277
if ($databaseUrl = $config['database']['url'] ?? null) {
8378
$factory = $factory->withDatabaseUri($databaseUrl);
8479
}

tests/FirebaseProjectManagerTest.php

+6-74
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ public function credentials_can_be_configured(): void
7777
$factory = $this->factoryForProject($projectName);
7878

7979
// Retrieve service account
80-
/** @var Firebase\ServiceAccount $serviceAccount */
81-
$serviceAccount = $this->getAccessibleMethod($factory, 'getServiceAccount')->invoke($factory);
80+
$serviceAccount = $this->getAccessibleProperty($factory, 'serviceAccount')->getValue($factory);
8281

8382
// Validate value
84-
$this->assertSame($credentials, $serviceAccount->asArray());
83+
$this->assertSame($credentials, $serviceAccount);
8584
}
8685

8786
/**
@@ -108,79 +107,12 @@ public function projects_can_have_different_credentials(): void
108107
$factory = $this->factoryForProject($projectName);
109108
$secondFactory = $this->factoryForProject($secondProjectName);
110109

111-
/** @var Firebase\ServiceAccount $serviceAccount */
112-
$serviceAccount = $this->getAccessibleMethod($factory, 'getServiceAccount')->invoke($factory);
113-
114-
/** @var Firebase\ServiceAccount $secondServiceAccount */
115-
$secondServiceAccount = $this->getAccessibleMethod($factory, 'getServiceAccount')->invoke($secondFactory);
110+
$serviceAccount = $this->getAccessibleProperty($factory, 'serviceAccount')->getValue($factory);
111+
$secondServiceAccount = $this->getAccessibleProperty($factory, 'serviceAccount')->getValue($secondFactory);
116112

117113
// Validate values
118-
$this->assertSame($credentials, $serviceAccount->asArray());
119-
$this->assertSame($secondCredentials, $secondServiceAccount->asArray());
120-
}
121-
122-
/**
123-
* @test
124-
*/
125-
public function credential_auto_discovery_is_enabled_by_default_for_default_project(): void
126-
{
127-
$projectName = $this->app->config->get('firebase.default');
128-
129-
$factory = $this->factoryForProject($projectName);
130-
131-
$this->getAccessibleMethod($factory, 'getServiceAccount')->invoke($factory);
132-
133-
$property = $this->getAccessibleProperty($factory, 'discoveryIsDisabled');
134-
135-
$this->assertFalse($property->getValue($factory));
136-
}
137-
138-
/**
139-
* @test
140-
*/
141-
public function credential_auto_discovery_can_be_disabled_for_default_project(): void
142-
{
143-
$projectName = $this->app->config->get('firebase.default');
144-
145-
$this->app->config->set('firebase.projects.' . $projectName . '.credentials.auto_discovery', false);
146-
147-
$factory = $this->factoryForProject($projectName);
148-
149-
$property = $this->getAccessibleProperty($factory, 'discoveryIsDisabled');
150-
151-
$this->assertTrue($property->getValue($factory));
152-
}
153-
154-
/**
155-
* @test
156-
*/
157-
public function credential_auto_discovery_is_not_enabled_by_default_for_other_projects(): void
158-
{
159-
$projectName = 'another-app';
160-
161-
$this->app->config->set('firebase.projects.' . $projectName . '.credentials', []);
162-
163-
$factory = $this->factoryForProject($projectName); // factory for default project with default settings
164-
165-
$property = $this->getAccessibleProperty($factory, 'discoveryIsDisabled');
166-
167-
$this->assertTrue($property->getValue($factory));
168-
}
169-
170-
/**
171-
* @test
172-
*/
173-
public function credential_auto_discovery_can_be_enabled_for_other_project(): void
174-
{
175-
$projectName = 'another-app';
176-
177-
$this->app->config->set('firebase.projects.' . $projectName . '.credentials.auto_discovery', true);
178-
179-
$factory = $this->factoryForProject($projectName);
180-
181-
$property = $this->getAccessibleProperty($factory, 'discoveryIsDisabled');
182-
183-
$this->assertFalse($property->getValue($factory));
114+
$this->assertSame($credentials, $serviceAccount);
115+
$this->assertSame($secondCredentials, $secondServiceAccount);
184116
}
185117

186118
/**

0 commit comments

Comments
 (0)