Code Duplication    Length = 20-21 lines in 2 locations

src/CarlosIO/Geckoboard/Data/Entry.php 1 location

@@ 83-102 (lines=20) @@
80
        return $this->value;
81
    }
82
83
    public function toArray()
84
    {
85
        $result = array();
86
        $text = $this->getText();
87
        if (null !== $text) {
88
            $result['text'] = $text;
89
        }
90
91
        $value = $this->getValue();
92
        if (null !== $value) {
93
            $result['value'] = $value;
94
        }
95
96
        $prefix = $this->getPrefix();
97
        if (null !== $prefix) {
98
            $result['prefix'] = $prefix;
99
        }
100
101
        return $result;
102
    }
103
}
104

src/CarlosIO/Geckoboard/Data/PieChart/Entry.php 1 location

@@ 90-110 (lines=21) @@
87
    /**
88
     * @return array
89
     */
90
    public function toArray()
91
    {
92
        $result = array();
93
94
        $value = $this->getValue();
95
        if (null !== $value) {
96
            $result['value'] = (string) $value;
97
        }
98
99
        $label = $this->getLabel();
100
        if (null !== $label) {
101
            $result['label'] = $label;
102
        }
103
104
        $color = $this->getColor();
105
        if (null !== $color) {
106
            $result['color'] = $color;
107
        }
108
109
        return $result;
110
    }
111
}
112