Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/Feed/Rss/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@

class Channel extends Element
{
// private $xmlVersion = "1.0";
private $xmlVersion = "1.0";
private $rssVersion = "2.0";

private $title = "";
private $link = "";
private $description = "";
// private $content = [];
// private $otherChannelMeta = [];
private $otherChannelMeta = [];

private $language = "";

Expand Down Expand Up @@ -69,15 +68,17 @@ public function unfold(): string
Element::description($this->description)
]);

// Shoop::dictionary($this->otherChannelMeta)->each(
// function($value, $element) use (&$content) {
// $content = $content->plus(Element::fold($element, $value));
// });
Shoop::dictionary($this->otherChannelMeta)->each(
function($value, $element) use (&$content) {
$content = $content->plus(Element::fold($element, $value));
});

$content = $content->plus(...$this->content);

return Shoop::string(
Element::rss(
Element::channel(
...Shoop::array($this->content)
...Shoop::array($content)
->each(function($item) {
return $item->unfold();
})
Expand Down
5 changes: 2 additions & 3 deletions tests/UIKit/SocialMetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public function testFacebook()
{
$expected = '<meta content="website" property="og:type"><meta content="Hello, World!" property="og:title"><meta content="https://8fold.pro" property="og:url"><meta content="A short description. LinkedIn would like to have 100+ characters." property="og:description">';
$actual = UIKit::socialMeta(
"website",
"Hello, World!",
"https://8fold.pro",
"A short description. LinkedIn would like to have 100+ characters."
Expand All @@ -21,11 +20,11 @@ public function testFacebook()

$expected = '<meta content="website" property="og:type"><meta content="Hello, World!" property="og:title"><meta content="https://8fold.pro" property="og:url"><meta content="A short description. LinkedIn would like to have 100+ characters." property="og:description"><meta content="https://8fold.pro/assets/ui/logo.svg" property="og:image"><meta content="ABCDEFGHIJKLMNOP" property="og:app_id">';
$actual = UIKit::socialMeta(
"website",
"Hello, World!",
"https://8fold.pro",
"A short description. LinkedIn would like to have 100+ characters.",
"https://8fold.pro/assets/ui/logo.svg",
"website",
"ABCDEFGHIJKLMNOP"
);
$this->assertEquals($expected, $actual->unfold());
Expand All @@ -35,11 +34,11 @@ public function testTwitter()
{
$expected = '<meta content="website" property="og:type"><meta content="Hello, World!" property="og:title"><meta content="https://8fold.pro" property="og:url"><meta content="A short description. LinkedIn would like to have 100+ characters." property="og:description"><meta content="https://8fold.pro/assets/ui/logo.svg" property="og:image"><meta content="ABCDEFGHIJKLMNOP" property="og:app_id"><meta name="twitter:card" content="summary_large_image">';
$actual = UIKit::socialMeta(
"website",
"Hello, World!",
"https://8fold.pro",
"A short description. LinkedIn would like to have 100+ characters.",
"https://8fold.pro/assets/ui/logo.svg",
"website",
"ABCDEFGHIJKLMNOP"
)->twitter();
$this->assertEquals($expected, $actual->unfold());
Expand Down