/**
* addFile(): defined by Report interface.
*
* @see Report::addFile()
* @param File $file
* @return void
*/
public function addFile(File $file)
{
$this->writer->startElement('file');
$this->writer->writeAttribute('name', $file->getFilename());
foreach ($file->getViolations() as $violation) {
$this->writer->startElement('error');
$this->writer->writeAttribute('line', $violation->getLine());
if ($violation->getColumn() > 0) {
$this->writer->writeAttribute('column', $violation->getColumn());
}
$this->writer->writeAttribute('severity', $violation->getSeverity());
$this->writer->writeAttribute('message', $violation->getMessage());
$this->writer->writeAttribute('source', $violation->getSource());
$this->writer->endElement();
}
$this->writer->endElement();
}