1 | <?php |
||
2 | /** |
||
3 | * VGetter operates |
||
4 | * User: moyo |
||
5 | * Date: 2018/6/7 |
||
6 | * Time: 1:56 PM |
||
7 | */ |
||
8 | |||
9 | namespace Carno\Web\Chips\Controller; |
||
10 | |||
11 | trait VGOps |
||
12 | { |
||
13 | /** |
||
14 | * @param string $name |
||
15 | * @return bool |
||
16 | */ |
||
17 | public function has(string $name) : bool |
||
18 | { |
||
19 | return $this->offsetExists($name); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param string $name |
||
24 | * @param mixed $default |
||
25 | * @return mixed |
||
26 | */ |
||
27 | public function get(string $name, $default = null) |
||
28 | { |
||
29 | return $this->$name ?? $default; |
||
30 | } |
||
31 | } |
||
32 |