Code Duplication    Length = 15-16 lines in 2 locations

src/PhpSpreadsheet/Style/Border.php 1 location

@@ 227-242 (lines=16) @@
224
     *
225
     * @return Border
226
     */
227
    public function setBorderStyle($pValue = self::BORDER_NONE)
228
    {
229
        if (empty($pValue)) {
230
            $pValue = self::BORDER_NONE;
231
        } elseif (is_bool($pValue) && $pValue) {
232
            $pValue = self::BORDER_MEDIUM;
233
        }
234
        if ($this->isSupervisor) {
235
            $styleArray = $this->getStyleArray(['style' => $pValue]);
236
            $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
237
        } else {
238
            $this->borderStyle = $pValue;
239
        }
240
241
        return $this;
242
    }
243
244
    /**
245
     * Get Border Color.

src/PhpSpreadsheet/Style/Font.php 1 location

@@ 463-477 (lines=15) @@
460
     *
461
     * @return Font
462
     */
463
    public function setUnderline($pValue = self::UNDERLINE_NONE)
464
    {
465
        if (is_bool($pValue)) {
466
            $pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE;
467
        } elseif ($pValue == '') {
468
            $pValue = self::UNDERLINE_NONE;
469
        }
470
        if ($this->isSupervisor) {
471
            $styleArray = $this->getStyleArray(['underline' => $pValue]);
472
            $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
473
        } else {
474
            $this->underline = $pValue;
475
        }
476
477
        return $this;
478
    }
479
480
    /**