Commit 4b1adaa
committed
Allow *bin2hex and *bin2base64 functions to keep non-empty-string type
Those functions should not return a string when they receive a
non-empty-string in input.
The following example is expected to work:
```php
<?php
/**
* @param non-empty-string $i
*/
function takesNonEmptyString(string $i): void {
echo $i;
}
takesNonEmptyString(bin2hex("a"));
takesNonEmptyString(base64_encode("a"));
```1 parent 0b790e0 commit 4b1adaa
1 file changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
337 | 353 | | |
338 | 354 | | |
339 | 355 | | |
| |||
1308 | 1324 | | |
1309 | 1325 | | |
1310 | 1326 | | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
1311 | 1330 | | |
1312 | 1331 | | |
1313 | 1332 | | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1314 | 1342 | | |
1315 | 1343 | | |
1316 | 1344 | | |
| |||
0 commit comments