Code Duplication    Length = 21-21 lines in 2 locations

main/inc/lib/pear/HTML/Table/Storage.php 2 locations

@@ 513-533 (lines=21) @@
510
     * @access   public
511
     * @throws   PEAR_Error
512
     */
513
    function setRowAttributes($row, $attributes, $inTR = false)
514
    {
515
        if (!$inTR) {
516
            $multiAttr = $this->_isAttributesArray($attributes);
517
            for ($i = 0; $i < $this->_cols; $i++) {
518
                if ($multiAttr) {
519
                    $this->setCellAttributes($row, $i,
520
                        $attributes[$i - ((ceil(($i + 1) / count($attributes))) - 1) * count($attributes)]);
521
                } else {
522
                    $this->setCellAttributes($row, $i, $attributes);
523
                }
524
            }
525
        } else {
526
            $attributes = $this->_parseAttributes($attributes);
527
            $err = $this->_adjustEnds($row, 0, 'setRowAttributes', $attributes);
528
            if (PEAR::isError($err)) {
529
                return $err;
530
            }
531
            $this->_structure[$row]['attr'] = $attributes;
532
        }
533
    }
534
535
    /**
536
     * Updates the row attributes for an existing row
@@ 546-566 (lines=21) @@
543
     * @access   public
544
     * @throws   PEAR_Error
545
     */
546
    function updateRowAttributes($row, $attributes = null, $inTR = false)
547
    {
548
        if (!$inTR) {
549
            $multiAttr = $this->_isAttributesArray($attributes);
550
            for ($i = 0; $i < $this->_cols; $i++) {
551
                if ($multiAttr) {
552
                    $this->updateCellAttributes($row, $i,
553
                        $attributes[$i - ((ceil(($i + 1) / count($attributes))) - 1) * count($attributes)]);
554
                } else {
555
                    $this->updateCellAttributes($row, $i, $attributes);
556
                }
557
            }
558
        } else {
559
            $attributes = $this->_parseAttributes($attributes);
560
            $err = $this->_adjustEnds($row, 0, 'updateRowAttributes', $attributes);
561
            if (PEAR::isError($err)) {
562
                return $err;
563
            }
564
            $this->_updateAttrArray($this->_structure[$row]['attr'], $attributes);
565
        }
566
    }
567
568
    /**
569
     * Returns the attributes for a given row as contained in the TR tag