Completed
Push — master ( 992921...3403b8 )
by recca
02:07
created

src/JArray.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

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
The property subject does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
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