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

Inn mask #1986

Open
wants to merge 13 commits into
base: next
Choose a base branch
from
Open

Inn mask #1986

wants to merge 13 commits into from

Conversation

tmaslov22
Copy link

Now you can use 12 digits of the Inn.

@codecov-io
Copy link

codecov-io commented Apr 24, 2020

Codecov Report

Merging #1986 into next will increase coverage by 0.34%.
The diff coverage is 96.96%.

Impacted file tree graph

@@             Coverage Diff              @@
##               next    #1986      +/-   ##
============================================
+ Coverage     70.21%   70.55%   +0.34%     
- Complexity     1600     1610      +10     
============================================
  Files           287      287              
  Lines          3864     3885      +21     
============================================
+ Hits           2713     2741      +28     
+ Misses         1151     1144       -7     
Impacted Files Coverage Δ Complexity Δ
src/Faker/Calculator/Inn.php 96.87% <96.66%> (-3.13%) 14.00 <13.00> (+11.00) ⬇️
src/Faker/Provider/Person.php 100.00% <100.00%> (ø) 15.00 <1.00> (+1.00)
src/Faker/Provider/ru_RU/Company.php 90.00% <100.00%> (-2.00%) 10.00 <0.00> (-2.00)
src/Faker/Provider/he_IL/Address.php 0.00% <0.00%> (-100.00%) 1.00% <0.00%> (ø%)
src/Faker/Provider/ko_KR/Company.php 50.00% <0.00%> (-50.00%) 2.00% <0.00%> (ø%)
src/Faker/Provider/fa_IR/Company.php 33.33% <0.00%> (-33.34%) 3.00% <0.00%> (ø%)
src/Faker/Provider/fi_FI/Address.php 33.33% <0.00%> (-33.34%) 3.00% <0.00%> (ø%)
src/Faker/Provider/cs_CZ/Address.php 66.66% <0.00%> (-33.34%) 3.00% <0.00%> (ø%)
src/Faker/Provider/sr_Latn_RS/Address.php 66.66% <0.00%> (-33.34%) 3.00% <0.00%> (ø%)
src/Faker/Provider/en_IN/Address.php 50.00% <0.00%> (-25.00%) 8.00% <0.00%> (ø%)
... and 36 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 c956e03...8fbb49c. Read the comment docs.

Copy link
Contributor

@pwsdotru pwsdotru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mask as param can be used for generate incorrect INN codes. Better is use type off INN

@@ -96,7 +96,7 @@ public static function companyNameSuffix()
return static::randomElement(static::$companyNameSuffixes);
}

public static function inn($area_code = "")
public static function inn($area_code = "", $mask = '#######')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use mask as parameter is not good idea. I think better is use type of INN: for Person (12 digits) or Company (10 digits)

And then use type inside method for generate mask.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or move INN generator to common function in \Faker\Calculator\Inn and add inn to Person.php too

Copy link
Author

@tmaslov22 tmaslov22 May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or move INN generator to common function in \Faker\Calculator\Inn and add inn to Person.php too

Thank you for your comments. Using Inn base class and divide the INN for the company and person will be more object-oriented way.

@@ -15,8 +15,11 @@ class Inn
public static function checksum($inn)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is possible add INN type (Person or Company) and then use it in cases inside method

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.

None yet

4 participants