-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Making Faker\Generator's accessable from outside. #186
Comments
This would be very helpful indeed |
Sounds good to me, not sure how this code looks in the current master/2.0-dev, but if you see a way to make an improvement there please send a PR :) |
+1 would be great! @h4cc have you any plan to do it soon? |
@theofidry No plan here yet ... |
Kind of old post so I have lost a little bit sight of what needs to be changed, but if we make the Nelmio\Alice\Loader\Base::getGenerator() |
Sounds ok to me but would be good to have @tshelburne's opinion as he's more aware of the 2.0 design. |
As in real life it is fairly rare to have to access to a faker instance (most of providers have static methods) and considering it's a fairly old issue and nobody really wants to dig into this again, I'll be closing this one. If it is still a problem and are willing to look into it, feel free to open a new issue for it. Note that it is plan to fix it in v3. |
Currently, the Faker Generators are enclosed inside the loaders:
https://github.com/nelmio/alice/blob/1.x/src/Nelmio/Alice/Loader/Base.php#L461
Accessing the Generators from the outside would be useful to be abled to create more Faker Provider that extend
Faker\Provider\Base
, because that needs a generator to build up on: https://github.com/fzaninotto/Faker/blob/master/src/Faker/Provider/Base.php#L24Simple Example:
Such a provider will need a Generator in its constructor, but these are not accessable outside the loaders till now.
Maybe this could be a change for 2.0?
The text was updated successfully, but these errors were encountered: