Типы для php-lint v2
This commit is contained in:
parent
f570da257d
commit
6173eb4892
31 changed files with 83 additions and 76 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue