Типы для php-lint v2

This commit is contained in:
origami11 2021-02-22 14:07:51 +03:00
parent f570da257d
commit 6173eb4892
31 changed files with 83 additions and 76 deletions

View file

@ -39,7 +39,7 @@ class Collection implements ArrayAccess
*
* @return void
*/
public function set(/*.string.*/$key, /*.any.*/$value)
public function set($key/*: string*/, $value/*: any*/)
{
$this->data[$key] = $value;
}
@ -58,7 +58,7 @@ class Collection implements ArrayAccess
public function getInt($key, $default = 0)
{
return intval($this->get($key, $default));
return (int)$this->get($key, $default);
}
public function getString($key, $default = '')
@ -68,7 +68,7 @@ class Collection implements ArrayAccess
public function getNat($key, $default = 1)
{
$result = intval($this->get($key, $default));
$result = (int)$this->get($key, $default);
return (($result > 0) ? $result : $default);
}