Skip to content

Missing dependencies when creating custom Faker Providers #42

Description

@nass600

Hi there!

Maybe I am missing something but following README instruction for adding new Faker providers lead me to the following error:

Symfony\Component\Debug\Exception\ContextErrorException]
Catchable Fatal Error: Argument 1 passed to Faker\Provider\Base::__construct() must be an instance of Faker\Generator, none given...

Every Faker Provider needs the dependency @faker.generator however this service is not registered by the bundle so if I add it the way:

services:
    your.faker.provider:
        class: YourProviderClass
        arguments: [@faker.generator]
        tags:
            -  { name: h4cc_alice_fixtures.provider }

I get the non existing dependency error.

Any clue?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions