Code Duplication    Length = 16-16 lines in 2 locations

src/validator/ValidationManager.class.php 2 locations

@@ 597-612 (lines=16) @@
594
     *
595
     * @deprecated 1.0.0
596
     */
597
    public function getValidatorIncidents($validatorName, $minSeverity = null)
598
    {
599
        $incidents = $this->report->byValidator($validatorName)->getIncidents();
600
        
601
        if ($minSeverity === null) {
602
            return $incidents;
603
        } else {
604
            $matchingIncidents = array();
605
            foreach ($incidents as $incident) {
606
                if ($incident->getSeverity() >= $minSeverity) {
607
                    $matchingIncidents[] = $incident;
608
                }
609
            }
610
            return $matchingIncidents;
611
        }
612
    }
613
    /**
614
     * Returns all incidents of a given field.
615
     *
@@ 626-641 (lines=16) @@
623
     *
624
     * @deprecated 1.0.0
625
     */
626
    public function getFieldIncidents($fieldname, $minSeverity = null)
627
    {
628
        $incidents = $this->report->byArgument($fieldname)->getIncidents();
629
        
630
        if ($minSeverity === null) {
631
            return $incidents;
632
        } else {
633
            $matchingIncidents = array();
634
            foreach ($incidents as $incident) {
635
                if ($incident->getSeverity() >= $minSeverity) {
636
                    $matchingIncidents[] = $incident;
637
                }
638
            }
639
            return $matchingIncidents;
640
        }
641
    }
642
643
    /**
644
     * Returns all errors of a given field.