alphazframework / framework

Core files of AlphaZ Framework
https://alphazframework.github.io/
MIT License
16 stars 17 forks source link

Enchantment of str class #247 - Adds hasUpercase and hasLowercase function with tests #260

Closed hasukmistry closed 5 years ago

hasukmistry commented 5 years ago

I have implemented my version of checking uppercase and lowercase in the string. It supports Unicode characters. Feedback will be highly appreciated.

https://github.com/zestframework/Zest_Framework/issues/247

codecov[bot] commented 5 years ago

Codecov Report

Merging #260 into master will increase coverage by 0.11%. The diff coverage is 75%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #260      +/-   ##
===========================================
+ Coverage       8.4%   8.51%   +0.11%     
- Complexity     1889    1893       +4     
===========================================
  Files           110     110              
  Lines          4782    4790       +8     
===========================================
+ Hits            402     408       +6     
- Misses         4380    4382       +2
Impacted Files Coverage Δ Complexity Δ
src/Data/Str.php 75.86% <75%> (-0.33%) 12 <4> (+4)

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 1a68e47...b5554e6. Read the comment docs.

peter279k commented 5 years ago

Duplicated PR #258.

And it seems that using the preg_match to accomplish the hasUppercase and hasLowercase methods.

hasukmistry commented 5 years ago

@peter279k I thought preg_match will be quick to perform the operation. Although I am open to suggestions here. If I can make my code better.

peter279k commented 5 years ago

Hi @hasukmistry, thanks for your reply.

It makes sense and I close PR #258.

Could you add more tests for these methods? And it can make their behaviors reliable :).

Such as adding the English uppercase/lowercase strings.

lablnet commented 5 years ago

@hasmukhmistry13 thanks you so much for your time to contribute really appropriated

You're most welcome to contribute more...

hasukmistry commented 5 years ago

@peter279k @Lablnet I will try to add more tests for these methods. And create another PR afterward.