[5.6] Feature/refactor Str::languageSpecificCharsArray()#23330
[5.6] Feature/refactor Str::languageSpecificCharsArray()#23330SergeyPodgornyy wants to merge 4 commits intolaravel:5.6from
Conversation
| { | ||
| $languageSpecific = static::languageSpecificCharsArray($language); | ||
|
|
||
| if (! is_null($languageSpecific)) { |
There was a problem hiding this comment.
is_object(), is_null() and similar is_*() functions calls are not analyzed, instead we recommend to rely on null identity and instanceof operators;
All 'is_null(...)' calls can be safely replaced with 'null === ...' constructs (or 'null !== ...' if the original construct was negated).
There was a problem hiding this comment.
The rest of the framework uses is_null
There was a problem hiding this comment.
@ntzm yes, but it will be more clear and correct to use null !== .... Should I revert this changes?
There was a problem hiding this comment.
It should stay consistent throughout the framework
|
I understand what you're trying to do, but this part of the code is taken from the Stringy library. Your changes will be lost next time we update this method. |
|
@sisve hm, good notice 👍 Should I contribute then to |
|
Pull Request to original repository in progress danielstjules/Stringy#179 |
Description
Improve readability of
Support\Str::languageSpecificCharsArray()Motivation and context
Associative array could be easier read and support as to different arrays, because you can always see which value refers to which value
How has this been tested?
All tests passed successfully
Types of changes
Checklist: