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 Recca0120\LoDash; |
||
4 | |||
5 | use ArrayObject; |
||
6 | use Recca0120\LoDash\JArray\Javascript; |
||
7 | |||
8 | class JArray extends ArrayObject |
||
9 | { |
||
10 | use Javascript; |
||
11 | |||
12 | /** |
||
13 | * value. |
||
14 | * |
||
15 | * @return array |
||
16 | */ |
||
17 | public function value() |
||
18 | { |
||
19 | return $this->subject; |
||
1 ignored issue
–
show
|
|||
20 | } |
||
21 | |||
22 | /** |
||
23 | * factory. |
||
24 | * @param array $subject |
||
25 | * @return static |
||
26 | */ |
||
27 | public static function factory($subject = []) |
||
28 | { |
||
29 | return new static((array) $subject); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * supports. |
||
34 | * @param static|array $object |
||
35 | * @return bool |
||
36 | */ |
||
37 | 1 | public static function supports($object) |
|
38 | { |
||
39 | 1 | if ($object instanceof static || is_array($object) === true) { |
|
40 | 1 | return true; |
|
41 | } |
||
42 | |||
43 | 1 | return false; |
|
44 | } |
||
45 | } |
||
46 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: