Issues (24)

src/Chips/Controller/VGOps.php (1 issue)

Labels
Severity
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
It seems like offsetExists() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        return $this->/** @scrutinizer ignore-call */ offsetExists($name);
Loading history...
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