aboutsummaryrefslogtreecommitdiff
path: root/formats/PlaintextFormat.php
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2022-07-01 15:10:30 +0200
committerGravatar GitHub <noreply@github.com> 2022-07-01 15:10:30 +0200
commit4f75591060d95208a301bc6bf460d875631b29cc (patch)
tree4e37d86840e8d990a563ba75d3de6f84a53cc2de /formats/PlaintextFormat.php
parent66568e3a39c61546c09a47a5688914a0bdf3c60c (diff)
downloadrss-bridge-4f75591060d95208a301bc6bf460d875631b29cc.tar.gz
rss-bridge-4f75591060d95208a301bc6bf460d875631b29cc.tar.zst
rss-bridge-4f75591060d95208a301bc6bf460d875631b29cc.zip
Reformat codebase v4 (#2872)
Reformat code base to PSR12 Co-authored-by: rssbridge <noreply@github.com>
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;
+ }
}