firestore-php icon indicating copy to clipboard operation
firestore-php copied to clipboard

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

Open yanisla35 opened this issue 6 years ago • 6 comments

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.

yanisla35 avatar Oct 15 '19 20:10 yanisla35

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.

alexmgillis avatar Oct 25 '19 12:10 alexmgillis

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

CHEWX avatar Jun 24 '20 11:06 CHEWX

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

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

trident505 avatar Sep 07 '20 01:09 trident505

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 ?

dcsambaa avatar Oct 27 '20 19:10 dcsambaa

Set the version number in the composer.json @dcsamba

CHEWX avatar Oct 30 '20 14:10 CHEWX

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

vmtb avatar Mar 11 '23 17:03 vmtb