| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace norsys\score\php\string\recipient; |
||
| 18 | function stringIs(string $string) :void |
||
|
|
|||
| 19 | { |
||
| 20 | ( |
||
| 21 | new isTrue( |
||
| 22 | utf8_decode($string) == $string |
||
| 23 | ) |
||
| 24 | ) |
||
| 25 | ->recipientOfTestIs( |
||
| 26 | new ifTrue( |
||
| 27 | function() use (& $string) |
||
| 28 | { |
||
| 29 | $string = utf8_encode($string); |
||
| 30 | } |
||
| 31 | ) |
||
| 32 | ) |
||
| 33 | ; |
||
| 34 | |||
| 35 | $this->recipient->stringIs($string); |
||
| 36 | } |
||
| 38 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.