Code Duplication    Length = 5-7 lines in 4 locations

web_interface/astpp/application/libraries/html2pdf/_class/parsingCss.class.php 4 locations

@@ 518-524 (lines=7) @@
515
            );
516
        }
517
518
        if (count($class)) {
519
            foreach ($class as $v) {
520
                $this->value['id_lst'][] = '*.'.$v;
521
                $this->value['id_lst'][] = '.'.$v;
522
                $this->value['id_lst'][] = $tagName.'.'.$v;
523
            }
524
        }
525
        if ($id) {
526
            $this->value['id_lst'][] = '*#'.$id;
527
            $this->value['id_lst'][] = '#'.$id;
@@ 525-529 (lines=5) @@
522
                $this->value['id_lst'][] = $tagName.'.'.$v;
523
            }
524
        }
525
        if ($id) {
526
            $this->value['id_lst'][] = '*#'.$id;
527
            $this->value['id_lst'][] = '#'.$id;
528
            $this->value['id_lst'][] = $tagName.'#'.$id;
529
        }
530
531
        // CSS style
532
        $styles = $this->_getFromCSS();
@@ 579-585 (lines=7) @@
576
        $this->value['id_lst']   = array();
577
        $this->value['id_lst'][] = '*';
578
        $this->value['id_lst'][] = $tagName;
579
        if (count($class)) {
580
            foreach ($class as $v) {
581
                $this->value['id_lst'][] = '*.'.$v;
582
                $this->value['id_lst'][] = '.'.$v;
583
                $this->value['id_lst'][] = $tagName.'.'.$v;
584
            }
585
        }
586
        if ($id) {
587
            $this->value['id_lst'][] = '*#'.$id;
588
            $this->value['id_lst'][] = '#'.$id;
@@ 586-590 (lines=5) @@
583
                $this->value['id_lst'][] = $tagName.'.'.$v;
584
            }
585
        }
586
        if ($id) {
587
            $this->value['id_lst'][] = '*#'.$id;
588
            $this->value['id_lst'][] = '#'.$id;
589
            $this->value['id_lst'][] = $tagName.'#'.$id;
590
        }
591
592
        // get the css styles from class
593
        $styles = $this->_getFromCSS();