susanBuck / e2-fall22

0 stars 0 forks source link

Error when using Faker in seedReviews #44

Closed bar181 closed 1 year ago

bar181 commented 1 year ago

file: AppCommand.php function: seedReviews(): line: $faker = Factory::create(); (Factory is underlined as an error) error: Undefined type 'Faker\Factory'.intelephense(1009)

I checked stackoverflow and found a work around by changing the settings for intelephense but don't like it. Specifically response #7 in the approved answer worked by disabling 2 checks in intellephense. I don't see the error anymore but assume this setting change can impact other stuff.

https://stackoverflow.com/questions/59149877/visual-studio-code-php-intelephense-keep-showing-not-necessary-error

bar181 commented 1 year ago

Forgot to add context. Yes this error occurs after adding: use Faker\Factory; And yes, the seeding data works as expected. It looks like just a syntax message when using VSCode

susanBuck commented 1 year ago

Hi @bar181 -

I connected to your server to try and recreate but I'm not seeing any errors/underlines on my end:

image

Can you try restarting VSCode - it's possible it's just not yet recognizing the addition of the Faker package.

If that doesn't do the trick, let me know.

bar181 commented 1 year ago

It worked ! Off and On again worked.
I reset the intelephense back to normal settings and all looks okay after restarting VSCode. Thank you !

susanBuck commented 1 year ago

no prob, glad it worked!

richiecarey commented 1 year ago

I too had the same issue and restarting VSCode resolved the issue here as well .. thanks!