src/Checks/CacheHeadersCheck.php
private function getMessage()
    {
        $ret = '';
        // Filter good messages
        $goodTypes = [ValidationResult::TYPE_GOOD, ValidationResult::TYPE_INFO];
        $good = array_filter(
            $this->result->getMessages(),
            function ($val, $key) use ($goodTypes) {
                if (in_array($val['messageType'], $goodTypes)) {
                    return true;
                }
                return false;
            },
            ARRAY_FILTER_USE_BOTH
        );
        if (!empty($good)) {
            $ret .= "GOOD: " . implode('; ', array_column($good, 'message')) . " ";
        }

        // Filter bad messages
        $badTypes = [ValidationResult::TYPE_ERROR, ValidationResult::TYPE_WARNING];
        $bad = array_filter(
            $this->result->getMessages(),
            function ($val, $key) use ($badTypes) {
                if (in_array($val['messageType'], $badTypes)) {
                    return true;
                }
                return false;
            },
            ARRAY_FILTER_USE_BOTH
        );
        if (!empty($bad)) {
            $ret .= "BAD: " . implode('; ', array_column($bad, 'message'));
        }
        return $ret;
    }
private function getMessage()
    {
        $ret = '';
        // Filter good messages
        $goodTypes = [ValidationResult::TYPE_GOOD, ValidationResult::TYPE_INFO];
        $good = array_filter(
            $this->result->getMessages(),
            function ($val, $key) use ($goodTypes) {
                if (in_array($val['messageType'], $goodTypes)) {
                    return true;
                }
                return false;
            },
            ARRAY_FILTER_USE_BOTH
        );
        if (!empty($good)) {
            $ret .= "GOOD: " . implode('; ', array_column($good, 'message')) . " ";
        }

        // Filter bad messages
        $badTypes = [ValidationResult::TYPE_ERROR, ValidationResult::TYPE_WARNING];
        $bad = array_filter(
            $this->result->getMessages(),
            function ($val, $key) use ($badTypes) {
                if (in_array($val['messageType'], $badTypes)) {
                    return true;
                }
                return false;
            },
            ARRAY_FILTER_USE_BOTH
        );
        if (!empty($bad)) {
            $ret .= "BAD: " . implode('; ', array_column($bad, 'message'));
        }
        return $ret;
    }
private function getMessage ( ) { $ ret = '' ; // Filter good messages $ goodTypes = [ ValidationResult :: TYPE_GOOD , ValidationResult :: TYPE_INFO ] ; $ good = array_filter ( $ this -> result -> getMessages ( ) , function ( $ val , $ key ) use ( $ goodTypes ) { if ( in_array ( $ val [ 'messageType' ] , $ goodTypes ) ) { return true ; } return false ; } , ARRAY_FILTER_USE_BOTH ) ; if ( ! empty ( $ good ) ) { $ ret .= "GOOD: " . implode ( '; ' , array_column ( $ good , 'message' ) ) . " " ; } // Filter bad messages $ badTypes = [ ValidationResult :: TYPE_ERROR , ValidationResult :: TYPE_WARNING ] ; $ bad = array_filter ( $ this -> result -> getMessages ( ) , function ( $ val , $ key ) use ( $ badTypes ) { if ( in_array ( $ val [ 'messageType' ] , $ badTypes ) ) { return true ; } return false ; } , ARRAY_FILTER_USE_BOTH ) ; if ( ! empty ( $ bad ) ) { $ ret .= "BAD: " . implode ( '; ' , array_column ( $ bad , 'message' ) ) ; } return $ ret ; }
Collate messages from ValidationResult so that it is clear which parts
of the check passed and which failed.

@return string
Collate messages from ValidationResult so that it is clear which parts of the check passed and which failed .