mirror of
https://github.com/anthonyaxenov/atol-online.git
synced 2024-11-22 19:44:34 +00:00
Новый файл helpers
This commit is contained in:
parent
c05e013a5a
commit
3ffab562f8
@ -46,6 +46,9 @@
|
|||||||
"src/AtolOnline/Traits/",
|
"src/AtolOnline/Traits/",
|
||||||
"src/AtolOnline/Constants/",
|
"src/AtolOnline/Constants/",
|
||||||
"tests/"
|
"tests/"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"src/helpers.php"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
16
src/helpers.php
Normal file
16
src/helpers.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (!function_exists('valid_strlen')) {
|
||||||
|
/**
|
||||||
|
* Возвращает корректную длину строки
|
||||||
|
*
|
||||||
|
* @param string $value
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
function valid_strlen(string $value): int
|
||||||
|
{
|
||||||
|
return function_exists('mb_strlen')
|
||||||
|
? mb_strlen($value)
|
||||||
|
: strlen($value);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user