Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Update optional() in readme to use v2 weight #2068

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patrickdaze
Copy link

Update documentation for optional() to use the new weight system (percent 0 to 100 instead of float 0 to 1).

optional() source code


🙏 Possible to add hacktoberfest-accepted label to this PR? (Details)

@codecov-io
Copy link

Codecov Report

Merging #2068 into master will decrease coverage by 0.26%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2068      +/-   ##
============================================
- Coverage     56.56%   56.30%   -0.27%     
  Complexity     2068     2068              
============================================
  Files           306      306              
  Lines          4849     4849              
============================================
- Hits           2743     2730      -13     
- Misses         2106     2119      +13     
Impacted Files Coverage Δ Complexity Δ
src/Faker/Provider/de_DE/Person.php 0.00% <0.00%> (-100.00%) 1.00% <0.00%> (ø%)
src/Faker/Provider/ne_NP/Person.php 0.00% <0.00%> (-50.00%) 2.00% <0.00%> (ø%)
src/Faker/Provider/id_ID/Company.php 50.00% <0.00%> (-50.00%) 2.00% <0.00%> (ø%)
src/Faker/Provider/en_UG/Person.php 40.00% <0.00%> (-40.00%) 5.00% <0.00%> (ø%)
src/Faker/Provider/ko_KR/Address.php 60.00% <0.00%> (-40.00%) 5.00% <0.00%> (ø%)
src/Faker/Provider/en_HK/Address.php 33.33% <0.00%> (-33.34%) 9.00% <0.00%> (ø%)
src/Faker/Provider/sr_RS/Address.php 66.66% <0.00%> (-33.34%) 3.00% <0.00%> (ø%)
src/Faker/Provider/ka_GE/Address.php 57.14% <0.00%> (-28.58%) 7.00% <0.00%> (ø%)
src/Faker/Provider/es_ES/Person.php 75.00% <0.00%> (-25.00%) 3.00% <0.00%> (ø%)
src/Faker/Provider/en_ZA/Address.php 50.00% <0.00%> (-25.00%) 4.00% <0.00%> (ø%)
... and 45 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5337ce5...5278dbb. Read the comment docs.

@pimjansen
Copy link
Contributor

I dont really see an actual usecase for this where the float is valid as well?

@patrickdaze
Copy link
Author

I assume it's still there for backwards compatibility.

This PR doesn't change functionality. It only updates the README based on the new system. Maybe I can open a separate PR for Faker v2 because it would be a breaking change? It would basically take care of the TODO in the optional() function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants