Skip to content

Commit

Permalink
JSONCreator: added docblocks remove pretty print
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Feb 16, 2024
1 parent 599c600 commit e44440e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/Creator/JSONCreator.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<?php


/**
* JSONCreator is a FeedCreator that implements the JSON Feed specification,
* as in https://jsonfeed.org/version/1.1
*
* @author Andreas Gohr <[email protected]>
*/
class JSONCreator extends FeedCreator
{

/** @inheritdoc */
public function createFeed()
{
$data = array();
Expand Down Expand Up @@ -42,7 +47,7 @@ public function createFeed()
if ($item->category) {
$entry['tags'] = (array)$item->category;
}
if($item->enclosure) {
if ($item->enclosure) {
// We only support one enclosure, JSONFeed 1.1 accepts multiple
$entry['attachments'] = array(
array(
Expand All @@ -56,6 +61,6 @@ public function createFeed()
$data['items'][] = $entry;
}

return json_encode($data, JSON_PRETTY_PRINT);
return json_encode($data);
}
}

0 comments on commit e44440e

Please sign in to comment.