Adds the Faker::Sports::Basketball Generator #1537
Merged
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.
Motivated by my discovery of the
Faker::Football
generator and the fact that my two favourite hobbies are basketball and programming, I decided to create a generator for basketball. Introducing theFaker::Sports::Basketball
generator!For now, I have added the following method to the generator (of course, this generator should be open for new methods or even new data added to its existing methods):
positions
: The 5 standard basketball positionsteams
: The names of the 30 teams in the NBAplayers
: The names of some NBA players. Since this list in real life is huge, I decided to stick to just the participants of the 2019 NBA All Star Gamecoaches
: The names of NBA coaches, current as of PR publicationPR CAVEATS
Basketball
, but it's very possible thatNBA
is a more appropriate name. Although the NBA is the most recognizable league in the world, there are of course other popular leagues around the globe (NCAA, Euroleague, etc). It's possible that a generator named "Basketball" should also be including data from more leagues than just basketballSports
and nested theBasketball
generator inside of it. If this is not welcome, I am okay with movingBasketball
to the globalFaker
namespace. I thought this could be useful because I can see how new generators could naturally be grouped intoSports
. But, if this move is accepted, then a future PR could move theFootball
andWorldCup
generators intoSports
unreleased
directory. I was not sure if this was necessary. It was definitely not mentioned in the contributing guide.Happy hooping!