diff --git a/.travis.yml b/.travis.yml index 39446a54..af337643 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ php: before_script: - composer install --dev --prefer-source -script: phpunit --coverage-text +script: make test matrix: allow_failures: diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..aec2d222 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +.PHONY: test test-all install update clean dev bower load assets + +test: + phpunit + cd docs && sphinx-build -W -b html -d _build/doctrees . _build/html diff --git a/lib/Exporter/Source/DoctrineODMQuerySourceIterator.php b/lib/Exporter/Source/DoctrineODMQuerySourceIterator.php index fad3a9d1..cc3de2cd 100644 --- a/lib/Exporter/Source/DoctrineODMQuerySourceIterator.php +++ b/lib/Exporter/Source/DoctrineODMQuerySourceIterator.php @@ -30,7 +30,7 @@ class DoctrineODMQuerySourceIterator implements SourceIteratorInterface protected $iterator; protected $propertyPaths; - + /** * @var PropertyAccess */ @@ -92,7 +92,7 @@ public function current() */ protected function getValue($value) { - if (is_array($value) or $value instanceof \Traversable) { + if (is_array($value) || $value instanceof \Traversable) { $value = null; } elseif ($value instanceof \DateTime) { $value = $value->format($this->dateTimeFormat); diff --git a/lib/Exporter/Writer/XmlExcelWriter.php b/lib/Exporter/Writer/XmlExcelWriter.php index 520f03e7..4a6e71a7 100644 --- a/lib/Exporter/Writer/XmlExcelWriter.php +++ b/lib/Exporter/Writer/XmlExcelWriter.php @@ -66,6 +66,7 @@ public function write(array $data) fwrite($this->file, $this->getXmlString($header)); $this->position++; } + fwrite($this->file, $this->getXmlString($data)); $this->position++; } @@ -91,7 +92,7 @@ private function getXmlString(array $fields = array()) $xmlData[] = ''; foreach ($fields as $key => $value) { $value = htmlspecialchars($value); - //$value = htmlentities($value); + $value = str_replace(array("\r\n", "\r", "\n"), ' ', $value); $dataType = 'String'; if ($this->position != 0 || !$this->showHeaders) {