private function getDetectionData($reports): array
    {
        $data = [
            'impact' => 0,
            'detections' => []
        ];
        foreach ($reports as $report) {
            $variableName = $report->getVarName();
            $filters = $report->getFilterMatch();
            if (!isset($data['detections'][$variableName])) {
                $data['detections'][$variableName] = [
                    'value' => $report->getVarValue(),
                    'events' => []
                ];
            }
            foreach ($filters as $filter) {
                $data['detections'][$variableName]['events'][] = [
                    'description' => $filter->getDescription(),
                    'impact' => $filter->getImpact()
                ];
                $data['impact'] += $filter->getImpact();
            }
        }
        return $data;
    }
private function getDetectionData($reports): array
    {
        $data = [
            'impact' => 0,
            'detections' => []
        ];
        foreach ($reports as $report) {
            $variableName = $report->getVarName();
            $filters = $report->getFilterMatch();
            if (!isset($data['detections'][$variableName])) {
                $data['detections'][$variableName] = [
                    'value' => $report->getVarValue(),
                    'events' => []
                ];
            }
            foreach ($filters as $filter) {
                $data['detections'][$variableName]['events'][] = [
                    'description' => $filter->getDescription(),
                    'impact' => $filter->getImpact()
                ];
                $data['impact'] += $filter->getImpact();
            }
        }
        return $data;
    }
private function getDetectionData ( $ reports ) : array { $ data = [ 'impact' => 0 , 'detections' => [ ] ] ; foreach ( $ reports as $ report ) { $ variableName = $ report -> getVarName ( ) ; $ filters = $ report -> getFilterMatch ( ) ; if ( ! isset ( $ data [ 'detections' ] [ $ variableName ] ) ) { $ data [ 'detections' ] [ $ variableName ] = [ 'value' => $ report -> getVarValue ( ) , 'events' => [ ] ] ; } foreach ( $ filters as $ filter ) { $ data [ 'detections' ] [ $ variableName ] [ 'events' ] [ ] = [ 'description' => $ filter -> getDescription ( ) , 'impact' => $ filter -> getImpact ( ) ] ; $ data [ 'impact' ] += $ filter -> getImpact ( ) ; } } return $ data ; }
Constructs a custom basic associative array based on the PHPIDS report
when an intrusion is detected. Will contains essential data such as
impact, targeted inputs and detection descriptions.

@param Report[] $reports
@return mixed[]
Constructs a custom basic associative array based on the PHPIDS report when an intrusion is detected . Will contains essential data such as impact targeted inputs and detection descriptions .