Code Duplication    Length = 14-14 lines in 3 locations

src/Index/Stats.php 1 location

@@ 65-78 (lines=14) @@
62
     *
63
     * @return mixed Data array entry or null if not found
64
     */
65
    public function get()
66
    {
67
        $data = $this->getData();
68
69
        foreach (\func_get_args() as $arg) {
70
            if (isset($data[$arg])) {
71
                $data = $data[$arg];
72
            } else {
73
                return null;
74
            }
75
        }
76
77
        return $data;
78
    }
79
80
    /**
81
     * Returns the index object.

src/Node/Info.php 1 location

@@ 74-87 (lines=14) @@
71
     *
72
     * @return mixed Data array entry or null if not found
73
     */
74
    public function get()
75
    {
76
        $data = $this->getData();
77
78
        foreach (\func_get_args() as $arg) {
79
            if (isset($data[$arg])) {
80
                $data = $data[$arg];
81
            } else {
82
                return null;
83
            }
84
        }
85
86
        return $data;
87
    }
88
89
    /**
90
     * Return port of the node.

src/Node/Stats.php 1 location

@@ 57-70 (lines=14) @@
54
     *
55
     * @return array Node stats for the given field or null if not found
56
     */
57
    public function get()
58
    {
59
        $data = $this->getData();
60
61
        foreach (\func_get_args() as $arg) {
62
            if (isset($data[$arg])) {
63
                $data = $data[$arg];
64
            } else {
65
                return null;
66
            }
67
        }
68
69
        return $data;
70
    }
71
72
    /**
73
     * Returns all stats data.