Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple projects #67

Merged
merged 21 commits into from
Nov 1, 2020
Merged

Conversation

dododedodonl
Copy link
Contributor

@dododedodonl dododedodonl commented Oct 26, 2020

This pull requests adds code to support multiple firebase projects in laravel via a new facade.

Since there is a breaking change in the configuration file, a major version bump is needed. Also, all existing facades are deprecated in favor of a single new facade to support multiple projects. They are however included for an easier upgrade path.

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #67 into main will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##                main       #67   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        19        44   +25     
===========================================
  Files              1         3    +2     
  Lines             71       121   +50     
===========================================
+ Hits              71       121   +50     
Impacted Files Coverage Δ Complexity Δ
src/FirebaseProject.php 100.00% <100.00%> (ø) 15.00 <15.00> (?)
src/FirebaseProjectManager.php 100.00% <100.00%> (ø) 22.00 <22.00> (?)
src/ServiceProvider.php 100.00% <100.00%> (ø) 7.00 <1.00> (-12.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87b5c23...a564794. Read the comment docs.

Copy link
Member

@jeromegamez jeromegamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great PR, thank you so much! Most of my change requests are not concerning the new behavior, just my personal preference as a maintainer, I hope you can see past that 😅

I'll try to test this for real soon, but this looks really, really good!

CHANGELOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/FirebaseProjectManager.php Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved

class FirebaseProject
{
/** @var \Kreait\Firebase\Factory $factory */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually don't include FQNs in PHPDocs, so this "risks" being changed to Kreait\Firebase\Factory (due to the existing import) or to Factory with an additional use statement somewhen in the future 🙈 (similarly elsewhere)

src/FirebaseProject.php Outdated Show resolved Hide resolved
src/FirebaseProject.php Outdated Show resolved Hide resolved

class FirebaseProjectManager
{
/** @var \Illuminate\Contracts\Foundation\Application */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check if this equally works with Illuminate\Contracts\Container\Container? This would probably mean that getting the config would have to be implemented differently, but I remember changing Application to Container in the past for better Lumen support.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look into it. I changed it to copy the resolveCredentials method to FirebaseProjectManager, as basePath does not exist on Container.

@@ -5,6 +5,7 @@
namespace Kreait\Laravel\Firebase;

use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Foundation\Application;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in FirebaseProjectManager - I used Container in other parts of the app because of Lumen and if it's possible, we should stick with that

@jeromegamez
Copy link
Member

Could you please also remove support for Laravel/Illuminate 5.8 in the composer.json and GitHub actions? I think orchestra/testbench ^3.8.6 can then go as well.

@dododedodonl
Copy link
Contributor Author

dododedodonl commented Oct 28, 2020

I think I incorporated all your suggestions 😃

  • Added docblock suggestion for facades
  • Added php-cs-fixer (copied config from kreait/firebase-php, commented out 2 rules)
  • Moved upgrade guide to UPGRADE.md
  • Removed Laravel and Lumen 5.8 support, removed orchestra/testbench:^3.8.6, lowered minimums to 4.0 and 5.0
  • Changed Illuminate\Contracts\Foundation\Application to Illuminate\Contracts\Container\Container
  • Other small fixes

@jeromegamez
Copy link
Member

Sorry for the late response (again) - I just tested it locally and it works just fine, and using the new Facade is so much more enjoyable!

I will merge this now, and after integrating the other open PR and making some minor changes, I'll release this as a new version! This will be a nice new major release, thank you so much! 🌺

@jeromegamez jeromegamez merged commit 292d5c8 into kreait:main Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants