src/Spamcop.php
public function parseSummaryReport()
    {

        $reports = [ ];

        preg_match_all(
            "/^\s*".
            "(?<ip>[a-f0-9:\.]+)\s+".
            "(?<date>\w+\s+\d+\s\d+)h\/".
            "(?<days>\d+)\s+".
            "(?<trap>\d+)\s+".
            "(?<user>\d+)\s+".
            "(?<mole>\d+)\s+".
            "(?<simp>\d+)".
            "/m",
            $this->parsedMail->getMessageBody(),
            $matches,
            PREG_SET_ORDER
        );

        if (is_array($matches) && count($matches) > 0) {
            foreach ($matches as $match) {
                $report = [
                    'Source-IP' => $match['ip'],
                    'Received-Date' => $match['date'] . ':00',
                    'Duration-Days' => $match['days'],
                ];
                foreach (['trap', 'user', 'mole', 'simp'] as $field) {
                    $report[ucfirst($field) ."-Report"] = $match[$field];
                }

                $reports[] = $report;
            }
        }

        return $reports;
    }
public function parseSummaryReport()
    {

        $reports = [ ];

        preg_match_all(
            "/^\s*".
            "(?<ip>[a-f0-9:\.]+)\s+".
            "(?<date>\w+\s+\d+\s\d+)h\/".
            "(?<days>\d+)\s+".
            "(?<trap>\d+)\s+".
            "(?<user>\d+)\s+".
            "(?<mole>\d+)\s+".
            "(?<simp>\d+)".
            "/m",
            $this->parsedMail->getMessageBody(),
            $matches,
            PREG_SET_ORDER
        );

        if (is_array($matches) && count($matches) > 0) {
            foreach ($matches as $match) {
                $report = [
                    'Source-IP' => $match['ip'],
                    'Received-Date' => $match['date'] . ':00',
                    'Duration-Days' => $match['days'],
                ];
                foreach (['trap', 'user', 'mole', 'simp'] as $field) {
                    $report[ucfirst($field) ."-Report"] = $match[$field];
                }

                $reports[] = $report;
            }
        }

        return $reports;
    }
public function parseSummaryReport ( ) { $ reports = [ ] ; preg_match_all ( "/^\s*" . "(?<ip>[a-f0-9:\.]+)\s+" . "(?<date>\w+\s+\d+\s\d+)h\/" . "(?<days>\d+)\s+" . "(?<trap>\d+)\s+" . "(?<user>\d+)\s+" . "(?<mole>\d+)\s+" . "(?<simp>\d+)" . "/m" , $ this -> parsedMail -> getMessageBody ( ) , $ matches , PREG_SET_ORDER ) ; if ( is_array ( $ matches ) && count ( $ matches ) > 0 ) { foreach ( $ matches as $ match ) { $ report = [ 'Source-IP' => $ match [ 'ip' ] , 'Received-Date' => $ match [ 'date' ] . ':00' , 'Duration-Days' => $ match [ 'days' ] , ] ; foreach ( [ 'trap' , 'user' , 'mole' , 'simp' ] as $ field ) { $ report [ ucfirst ( $ field ) . "-Report" ] = $ match [ $ field ] ; } $ reports [ ] = $ report ; } } return $ reports ; }
This is a spamcop formatted summery with a multiple incidents

@return array $reports
This is a spamcop formatted summery with a multiple incidents