Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 378fe3a

Browse files
authored
Merge pull request #53 from 8fold/feed-rss
fixes
2 parents 6c78671 + d1be772 commit 378fe3a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/Feed/Rss/Channel.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010

1111
class Channel extends Element
1212
{
13-
// private $xmlVersion = "1.0";
13+
private $xmlVersion = "1.0";
1414
private $rssVersion = "2.0";
1515

1616
private $title = "";
1717
private $link = "";
1818
private $description = "";
19-
// private $content = [];
20-
// private $otherChannelMeta = [];
19+
private $otherChannelMeta = [];
2120

2221
private $language = "";
2322

@@ -69,15 +68,17 @@ public function unfold(): string
6968
Element::description($this->description)
7069
]);
7170

72-
// Shoop::dictionary($this->otherChannelMeta)->each(
73-
// function($value, $element) use (&$content) {
74-
// $content = $content->plus(Element::fold($element, $value));
75-
// });
71+
Shoop::dictionary($this->otherChannelMeta)->each(
72+
function($value, $element) use (&$content) {
73+
$content = $content->plus(Element::fold($element, $value));
74+
});
75+
76+
$content = $content->plus(...$this->content);
7677

7778
return Shoop::string(
7879
Element::rss(
7980
Element::channel(
80-
...Shoop::array($this->content)
81+
...Shoop::array($content)
8182
->each(function($item) {
8283
return $item->unfold();
8384
})

tests/UIKit/SocialMetaTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public function testFacebook()
1212
{
1313
$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">';
1414
$actual = UIKit::socialMeta(
15-
"website",
1615
"Hello, World!",
1716
"https://8fold.pro",
1817
"A short description. LinkedIn would like to have 100+ characters."
@@ -21,11 +20,11 @@ public function testFacebook()
2120

2221
$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">';
2322
$actual = UIKit::socialMeta(
24-
"website",
2523
"Hello, World!",
2624
"https://8fold.pro",
2725
"A short description. LinkedIn would like to have 100+ characters.",
2826
"https://8fold.pro/assets/ui/logo.svg",
27+
"website",
2928
"ABCDEFGHIJKLMNOP"
3029
);
3130
$this->assertEquals($expected, $actual->unfold());
@@ -35,11 +34,11 @@ public function testTwitter()
3534
{
3635
$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">';
3736
$actual = UIKit::socialMeta(
38-
"website",
3937
"Hello, World!",
4038
"https://8fold.pro",
4139
"A short description. LinkedIn would like to have 100+ characters.",
4240
"https://8fold.pro/assets/ui/logo.svg",
41+
"website",
4342
"ABCDEFGHIJKLMNOP"
4443
)->twitter();
4544
$this->assertEquals($expected, $actual->unfold());

0 commit comments

Comments
 (0)