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

add Faker provider #177

Merged
merged 2 commits into from
Feb 10, 2022
Merged

add Faker provider #177

merged 2 commits into from
Feb 10, 2022

Conversation

IonBazan
Copy link
Contributor

This PR adds simple Faker integration. Since nelmio/alice allows to use <(My\Awesome\Suit::HEART)> notation, there is no point for enum() generator but I think randomEnum() is still valid.

Registering the provider in v1 required some manual work in services.yaml. Do you think we could automate that with bundle configuration like this:

elao_enum:
  nelmio_alice:
    aliases:
       Suit: App\Enums\Suit
       Permissions: App\Enums\Permissions

Would that make sense?

@ogizanagi ogizanagi added this to In Progress in v2.0 via automation Jan 28, 2022
@ogizanagi ogizanagi added this to the 2.x milestone Jan 28, 2022
@ogizanagi ogizanagi mentioned this pull request Jan 28, 2022
24 tasks
@ogizanagi
Copy link
Member

I think there is not much benefit to have a bundle config for this, since registering the provider in Alice is done this way:

services:
  Elao\Enum\Bridge\Faker\Provider\EnumProvider:
    arguments:
      - Suit: App\Enums\Suit
        Permissions: App\Enums\Permissions
  tags: ['nelmio_alice.faker.provider']

which is simple enough not to bother about introducing another conditional config entry.

@ogizanagi
Copy link
Member

Thanks @IonBazan.

@ogizanagi ogizanagi merged commit 27e0c46 into Elao:2.x Feb 10, 2022
v2.0 automation moved this from In Progress to Done Feb 10, 2022
@IonBazan IonBazan deleted the feature/faker-provider branch February 10, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
v2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants