diff options
author | 2016-09-10 20:41:11 +0200 | |
---|---|---|
committer | 2016-09-10 20:41:11 +0200 | |
commit | 62eec43980a3b85134606383996b81084d8fa32c (patch) | |
tree | e3d816bcc9d60794600322702df906044cf6ac5d /formats/JsonFormat.php | |
parent | 32ce2b65411d0cb02a0116bf05fef234e52e7c8f (diff) | |
download | rss-bridge-62eec43980a3b85134606383996b81084d8fa32c.tar.gz rss-bridge-62eec43980a3b85134606383996b81084d8fa32c.tar.zst rss-bridge-62eec43980a3b85134606383996b81084d8fa32c.zip |
[core] Apply common indentation
All files are now using tabs for indentation
Diffstat (limited to 'formats/JsonFormat.php')
-rw-r--r-- | formats/JsonFormat.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/formats/JsonFormat.php b/formats/JsonFormat.php index e173f230..ac6e450a 100644 --- a/formats/JsonFormat.php +++ b/formats/JsonFormat.php @@ -3,19 +3,18 @@ * Json * Builds a JSON string from $this->items and return it to browser. */ -class JsonFormat extends FormatAbstract{ +class JsonFormat extends FormatAbstract { - public function stringify(){ - $items = $this->getItems(); + public function stringify(){ + $items = $this->getItems(); + return json_encode($items, JSON_PRETTY_PRINT); + } - return json_encode($items, JSON_PRETTY_PRINT); - } + public function display(){ + $this + ->setContentType('application/json') + ->callContentType(); - public function display(){ - $this - ->setContentType('application/json') - ->callContentType(); - - return parent::display(); - } + return parent::display(); + } } |