This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Override Factory base Generator class without touching create-method #1988
Open
mingalevme
wants to merge
10
commits into
fzaninotto:master
Choose a base branch
from
mingalevme:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…writing the whole create-method
Faker\Provider\ru_RU\Person uses suffix "a" to make a female last name from male, but used symbol was a latin "a" (ASCII fzaninotto#97) and not cyrillic "a" (ASCII fzaninotto#208), so the final last name was "some cyrillic symbols" + "latin a", now female last name forms correctly: cyrillic male last name + cyrillic "a".
Codecov Report
@@ Coverage Diff @@
## master #1988 +/- ##
============================================
- Coverage 56.56% 56.44% -0.13%
- Complexity 2068 2069 +1
============================================
Files 306 306
Lines 4849 4851 +2
============================================
- Hits 2743 2738 -5
- Misses 2106 2113 +7
Continue to review full report at Codecov.
|
…rm populator (fzaninotto#1995) Bug: fzaninotto#1862 Clear specific entities is deprecated and will not be supported in Doctrine 3.0. (doctrine/orm@9ccb883) Bug introduced: c49cd54 Related issue: https://stackoverflow.com/questions/18215975/doctrine-a-new-entity-was-found-through-the-relationship
Faker\Provider\ru_RU\Person uses suffix "a" to make a female last name from male, but used symbol was a latin "a" (ASCII fzaninotto#97) and not cyrillic "a" (ASCII fzaninotto#208), so the final last name was "some cyrillic symbols" + "latin a", now female last name forms correctly: cyrillic male last name + cyrillic "a".
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added possibility to override Factory base Generator class without rewriting the whole create-method.
In my Laravel project I have custom Generator like this:
The class provides a single place to manage Generator providers and more over - I have IDE suggestions because of class annotations.
So to replace the base Generator-class everywhere in the project i should override Generator-instantiating (Laravel-level code):
But I don't want to replace the logic of setting up the generator (because it can be changed in the future):
So moving creating the new Generator instance in the separate protected-method do the trick:
What do you think?