chore: Аннотации к типам
This commit is contained in:
parent
704e4e0bd5
commit
8588173079
9 changed files with 80 additions and 27 deletions
|
|
@ -8,21 +8,29 @@
|
|||
namespace ctiso;
|
||||
|
||||
class Primitive {
|
||||
// varchar
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public static function to_varchar($value): string
|
||||
{
|
||||
return ((string) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function from_varchar($value)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
// int
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public static function to_bool($value): bool
|
||||
{
|
||||
return filter_var($value, FILTER_VALIDATE_BOOLEAN);//(int)((bool) $value);
|
||||
return filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue