aboutsummaryrefslogtreecommitdiff
path: root/formats/PlaintextFormat.php
diff options
context:
space:
mode:
Diffstat (limited to 'formats/PlaintextFormat.php')
-rw-r--r--formats/PlaintextFormat.php31
1 files changed, 17 insertions, 14 deletions
diff --git a/formats/PlaintextFormat.php b/formats/PlaintextFormat.php
index a1ef9e7f..a1e125c7 100644
--- a/formats/PlaintextFormat.php
+++ b/formats/PlaintextFormat.php
@@ -1,24 +1,27 @@
<?php
+
/**
* Plaintext
* Returns $this->items as raw php data.
*/
-class PlaintextFormat extends FormatAbstract {
- const MIME_TYPE = 'text/plain';
+class PlaintextFormat extends FormatAbstract
+{
+ const MIME_TYPE = 'text/plain';
- public function stringify(){
- $items = $this->getItems();
- $data = array();
+ public function stringify()
+ {
+ $items = $this->getItems();
+ $data = [];
- foreach($items as $item) {
- $data[] = $item->toArray();
- }
+ foreach ($items as $item) {
+ $data[] = $item->toArray();
+ }
- $toReturn = print_r($data, true);
+ $toReturn = print_r($data, true);
- // Remove invalid non-UTF8 characters
- ini_set('mbstring.substitute_character', 'none');
- $toReturn = mb_convert_encoding($toReturn, $this->getCharset(), 'UTF-8');
- return $toReturn;
- }
+ // Remove invalid non-UTF8 characters
+ ini_set('mbstring.substitute_character', 'none');
+ $toReturn = mb_convert_encoding($toReturn, $this->getCharset(), 'UTF-8');
+ return $toReturn;
+ }
}