Code Duplication    Length = 7-8 lines in 2 locations

src/CarlosIO/Geckoboard/Widgets/LineChart.php 1 location

@@ 133-140 (lines=8) @@
130
     * @param string $dimension The dimension where labels will be displayed
131
     * @param mix    $label     Label displayed in this axis
132
     */
133
    protected function addLabel($dimension, $label)
134
    {
135
        if (!in_array($dimension, array(self::DIMENSION_X, self::DIMENSION_Y))) {
136
            throw new \InvalidArgumentException(sprintf("Value '%s' is not a valid dimension", $dimension));
137
        }
138
139
        $this->axis[$dimension][] = $label;
140
    }
141
142
    /**
143
     * Return axises in a 2D array.

src/CarlosIO/Geckoboard/Widgets/LineChartV2.php 1 location

@@ 70-76 (lines=7) @@
67
     * @param string $dimension The dimension where labels will be displayed
68
     * @param mix    $label     Label displayed in this axis
69
     */
70
    protected function addLabel($dimension, $label) {
71
        if (!in_array($dimension, array(self::DIMENSION_X, self::DIMENSION_Y))) {
72
            throw new \InvalidArgumentException(sprintf("Value '%s' is not a valid dimension", $dimension));
73
        }
74
75
        $this->axis[$dimension][] = $label;
76
    }
77
78
    /**
79
     * Return axises in a 2D array