chore: Аннотации к типам

This commit is contained in:
origami11@yandex.ru 2025-10-27 16:39:44 +03:00
parent 730a608f9b
commit 89913de4fe
19 changed files with 124 additions and 24 deletions

View file

@ -25,12 +25,21 @@ class Primitive {
return filter_var($value, FILTER_VALIDATE_BOOLEAN);//(int)((bool) $value);
}
/**
* Преобразование значения в булевое значение
* @param string $value
* @return bool
*/
public static function from_bool($value): bool
{
return ((bool) $value);
}
// int
/**
* Преобразование значения в целое число
* @param string $value
* @return int
*/
public static function to_int($value): int
{
return ((int) $value);