Skip to content
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

Implement StringHelper::mask Method #20032

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

salehhashemi1992
Copy link
Contributor

@salehhashemi1992 salehhashemi1992 commented Oct 23, 2023

Introduce mask method in the StringHelper class.

This method is particularly useful for hiding parts of sensitive information like email addresses or phone numbers and so on.
Tests are included

Usage

$result = StringHelper::mask("1234567890", 2, 6); // Output will be "12******90"

@salehhashemi1992 salehhashemi1992 changed the title Add Mask Method to StringHelper Class Implement Mask Method to StringHelper Class Oct 23, 2023
@salehhashemi1992 salehhashemi1992 changed the title Implement Mask Method to StringHelper Class Implement Mask Method in StringHelper Class Oct 23, 2023
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (778d708) 47.95% compared to head (2c03287) 47.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20032      +/-   ##
==========================================
- Coverage   47.95%   47.50%   -0.46%     
==========================================
  Files         445      445              
  Lines       43866    43392     -474     
==========================================
- Hits        21037    20612     -425     
+ Misses      22829    22780      -49     
Files Coverage Δ
framework/helpers/BaseStringHelper.php 99.41% <100.00%> (+0.02%) ⬆️

... and 16 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@salehhashemi1992 salehhashemi1992 marked this pull request as ready for review October 23, 2023 18:19
@salehhashemi1992 salehhashemi1992 force-pushed the feature/string-mask-method branch from 82af5aa to e5eba4b Compare October 23, 2023 18:39
@salehhashemi1992 salehhashemi1992 changed the title Implement Mask Method in StringHelper Class Implement StringHelper::mask Method Oct 23, 2023
@samdark samdark requested review from a team October 24, 2023 11:36
@salehhashemi1992 salehhashemi1992 force-pushed the feature/string-mask-method branch from c9e75ff to 1396dce Compare October 24, 2023 20:19
@salehhashemi1992 salehhashemi1992 force-pushed the feature/string-mask-method branch from 1396dce to cbe094f Compare October 24, 2023 20:21
@bizley
Copy link
Member

bizley commented Oct 25, 2023

Add a changelog line please.

@salehhashemi1992
Copy link
Contributor Author

@bizley Done

@samdark samdark merged commit e2773e4 into yiisoft:master Oct 25, 2023
48 of 49 checks passed
@samdark
Copy link
Member

samdark commented Oct 25, 2023

Thank you!

@samdark samdark added this to the 2.0.50 milestone Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants