Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 16
CargoEmbeddedFormat
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 3
20
0.00% covered (danger)
0.00%
0 / 16
 allowedParameters
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 displayRow
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 8
 display
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 6
<?php
/**
 * @author Yaron Koren
 * @ingroup Cargo
 */
class CargoEmbeddedFormat extends CargoDisplayFormat {
    public static function allowedParameters() {
        return [];
    }
    protected function displayRow( $row ) {
        $pageName = reset( $row );
        $wikiText = <<<END
<p style="font-size: small; text-align: right;">[[$pageName]]</p>
{{:$pageName}}
--------------
END;
        return $wikiText;
    }
    /**
     * @param array $valuesTable
     * @param array $formattedValuesTable Unused
     * @param array $fieldDescriptions Unused
     * @param array $displayParams Unused
     * @return string
     */
    public function display( $valuesTable, $formattedValuesTable, $fieldDescriptions, $displayParams ) {
        $text = '';
        foreach ( $valuesTable as $row ) {
            $text .= $this->displayRow( $row );
        }
        return CargoUtils::smartParse( $text, $this->mParser );
    }
}