Code Duplication    Length = 8-9 lines in 2 locations

src/SendGridApi.php 2 locations

@@ 186-194 (lines=9) @@
183
     * @param string $value
184
     * @return $this
185
     */
186
    public function addSection($key, $value)
187
    {
188
189
        if (empty($this->sg_params['section'])) {
190
            $this->sg_params['section'] = new Sections();
191
        }
192
        $this->sg_params['section']->$key = $value;
193
        return $this;
194
    }
195
196
    /**
197
     * @param Headers $headers
@@ 211-218 (lines=8) @@
208
     * @param string $value
209
     * @return $this
210
     */
211
    public function addHeaders($key, $value)
212
    {
213
        if (empty($this->sg_params['headers'])) {
214
            $this->sg_params['headers'] = new Headers();
215
        }
216
        $this->sg_params['headers']->$key = $value;
217
        return $this;
218
    }
219
220
    /**
221
     * @param array $categories