src/acdhOeaw/util/metadataValidator/MetadataValidator.php
static public function printResults(array $results, string $format = 'text') {
        if ($format == 'tsv') {
            echo "subject\tmessage\tproperty\tvalue\n";
            foreach ($results as $i) {
                echo $i . "\n";
            }
        } else {
            $len = array(9, 9, 10, 7);
            foreach ($results as $i) {
                $len[0] = max($len[0], mb_strlen($i->resUri) + 2);
                $len[1] = max($len[1], mb_strlen($i->message) + 2);
                $len[2] = max($len[2], mb_strlen($i->property) + 2);
                $len[3] = max($len[3], mb_strlen($i->value) + 2);
            }
            $format = sprintf("%% %ds%% %ds%% %ds%% %ds\n", $len[0], $len[1], $len[2], $len[3]);
            printf($format, 'subject', 'message', 'property', 'value');
            foreach ($results as $i) {
                printf($format, $i->resUri, $i->message, $i->property, $i->value);
            }
        }
    }
static public function printResults(array $results, string $format = 'text') {
        if ($format == 'tsv') {
            echo "subject\tmessage\tproperty\tvalue\n";
            foreach ($results as $i) {
                echo $i . "\n";
            }
        } else {
            $len = array(9, 9, 10, 7);
            foreach ($results as $i) {
                $len[0] = max($len[0], mb_strlen($i->resUri) + 2);
                $len[1] = max($len[1], mb_strlen($i->message) + 2);
                $len[2] = max($len[2], mb_strlen($i->property) + 2);
                $len[3] = max($len[3], mb_strlen($i->value) + 2);
            }
            $format = sprintf("%% %ds%% %ds%% %ds%% %ds\n", $len[0], $len[1], $len[2], $len[3]);
            printf($format, 'subject', 'message', 'property', 'value');
            foreach ($results as $i) {
                printf($format, $i->resUri, $i->message, $i->property, $i->value);
            }
        }
    }
static public function printResults ( array $ results , string $ format = 'text' ) { if ( $ format == 'tsv' ) { echo "subject\tmessage\tproperty\tvalue\n" ; foreach ( $ results as $ i ) { echo $ i . "\n" ; } } else { $ len = array ( 9 , 9 , 10 , 7 ) ; foreach ( $ results as $ i ) { $ len [ 0 ] = max ( $ len [ 0 ] , mb_strlen ( $ i -> resUri ) + 2 ) ; $ len [ 1 ] = max ( $ len [ 1 ] , mb_strlen ( $ i -> message ) + 2 ) ; $ len [ 2 ] = max ( $ len [ 2 ] , mb_strlen ( $ i -> property ) + 2 ) ; $ len [ 3 ] = max ( $ len [ 3 ] , mb_strlen ( $ i -> value ) + 2 ) ; } $ format = sprintf ( "%% %ds%% %ds%% %ds%% %ds\n" , $ len [ 0 ] , $ len [ 1 ] , $ len [ 2 ] , $ len [ 3 ] ) ; printf ( $ format , 'subject' , 'message' , 'property' , 'value' ) ; foreach ( $ results as $ i ) { printf ( $ format , $ i -> resUri , $ i -> message , $ i -> property , $ i -> value ) ; } } }
Pretty prints a list of errors.
@param array $results list of errors
@param string $format print format: tsv or text
Pretty prints a list of errors .