morrislaptop / firestore-php

Firestore SDK for PHP without gRPC
MIT License
67 stars 31 forks source link

Fatal error : Morrislaptop\Firestore\Firestore must be compatible with Kreait\Firebase\Factory #15

Open yanisla35 opened 5 years ago

yanisla35 commented 5 years ago

Hi,

I tried to use morrislaptop/Firestore-PHP SDK but when i try with the "Sample usage" example, this is what happened :

error2

" Fatal error: Declaration of Morrislaptop\Firestore\Factory::createFirestore(): Morrislaptop\Firestore\Firestore must be compatible with Kreait\Firebase\Factory::createFirestore(?array $firestoreClientConfig = NULL): Kreait\Firebase\Firestore in C:\wamp64\www\test\vendor\morrislaptop\firestore-php\src\Factory.php on line 11"

And, this is my code :

code2

Is there anything I do wrong ? Of course, everything is fine in my firestoreDb (users ->123456).

Thank you in advance.

Thank you in advance.

alexmgillis commented 4 years ago

I had a similar issue and it turns out i was using a newer versions of krait/firebase so i reinstalled them with a lesser version as suggested by composer: "kreait/firebase-php": "4.15", "kreait/firebase-tokens": "1.8.1", and now seems to be working, hope it helps.

CHEWX commented 4 years ago

Be good not to use a very old version of firebase-php

trident505 commented 4 years ago

Be good not to use a very old version of firebase-php

But this git works on old version.. hm...

dcsambaa commented 3 years ago

I had a similar issue and it turns out i was using a newer versions of krait/firebase so i reinstalled them with a lesser version as suggested by composer: "kreait/firebase-php": "4.15", "kreait/firebase-tokens": "1.8.1", and now seems to be working, hope it helps.

I have the same problem, how did you reinstall a lesser version of krait/firebase ?

CHEWX commented 3 years ago

Set the version number in the composer.json @dcsamba

vmtb commented 1 year ago

I had a similar issue and it turns out i was using a newer versions of krait/firebase so i reinstalled them with a lesser version as suggested by composer: "kreait/firebase-php": "4.15", "kreait/firebase-tokens": "1.8.1", and now seems to be working, hope it helps.

Works for me 😊😊 Thanks