These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Ibonly\PotatoORM; |
||
4 | |||
5 | use Ibonly\PotatoORM\GetDataInterface; |
||
6 | |||
7 | class GetData implements GetDataInterface |
||
8 | { |
||
9 | protected $value; |
||
10 | |||
11 | function __construct($value) |
||
0 ignored issues
–
show
|
|||
12 | { |
||
13 | $this->value = $value; |
||
14 | } |
||
15 | |||
16 | public function all() |
||
17 | { |
||
18 | return json_encode($this->value); |
||
19 | } |
||
20 | |||
21 | public function getData($name) |
||
22 | { |
||
23 | foreach (json_decode($this->all()) as $key) { |
||
24 | return $key->$name; |
||
25 | } |
||
26 | } |
||
27 | |||
28 | public function getCount() |
||
29 | { |
||
30 | return sizeof($this->value); |
||
31 | } |
||
32 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.