Respect / Validation

The most awesome validation engine ever created for PHP
https://respect-validation.readthedocs.io
MIT License
5.79k stars 776 forks source link

Call mbstring functions without getting encoding #1337

Closed henriquemoody closed 3 years ago

henriquemoody commented 3 years ago

The functions from the mbstring can deal find with strings without forcing a specific encoding. However, sometimes "mb_detect_encoding()" cannot identify the encoding therefore the functions that expect a valid encoding will trigger a PHP error.

This commit will remove the unnecessary use of "mb_detect_encoding()."

Close #681

codecov-io commented 3 years ago

Codecov Report

Merging #1337 (51ad23e) into master (3dcd859) will increase coverage by 0.03%. The diff coverage is 91.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1337      +/-   ##
============================================
+ Coverage     95.77%   95.81%   +0.03%     
  Complexity      948      948              
============================================
  Files           191      191              
  Lines          2014     2006       -8     
============================================
- Hits           1929     1922       -7     
+ Misses           85       84       -1     
Impacted Files Coverage Δ Complexity Δ
library/Rules/In.php 94.73% <50.00%> (+4.26%) 11.00 <0.00> (ø)
library/Rules/Charset.php 100.00% <100.00%> (ø) 3.00 <0.00> (ø)
library/Rules/Contains.php 86.66% <100.00%> (-0.84%) 8.00 <0.00> (ø)
library/Rules/EndsWith.php 100.00% <100.00%> (ø) 7.00 <0.00> (ø)
library/Rules/Length.php 100.00% <100.00%> (ø) 18.00 <0.00> (ø)
library/Rules/Lowercase.php 100.00% <100.00%> (ø) 2.00 <0.00> (ø)
library/Rules/StartsWith.php 100.00% <100.00%> (ø) 7.00 <0.00> (ø)
library/Rules/Uppercase.php 100.00% <100.00%> (ø) 2.00 <0.00> (ø)

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 3dcd859...51ad23e. Read the comment docs.