Skip to content
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
20 changes: 10 additions & 10 deletions docs/snippets/advanced-directive-array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<array_directive>

<user>
<name>Dr. Mozelle Hand V</name>
<avatar>https://via.placeholder.com/640x480.png/00ddee?text=iste</avatar>
<avatar>https://via.placeholder.com/640x480.png/00aaaa?text=dolorem</avatar>
<images name="laborum tenetur non">https://via.placeholder.com/640x480.png/002288?text=quasi</images>
<images name="illum quam sit">https://via.placeholder.com/640x480.png/00aa66?text=explicabo</images>
<name>Prof. Maximo Grady PhD</name>
<avatar>https://via.placeholder.com/640x480.png/00dd77?text=consectetur</avatar>
<avatar>https://via.placeholder.com/640x480.png/00eeff?text=aliquam</avatar>
<images name="placeat iste sint">https://via.placeholder.com/640x480.png/007799?text=minima</images>
<images name="consequuntur omnis porro">https://via.placeholder.com/640x480.png/00aa55?text=commodi</images>
</user>
<user>
<name>Lori Gislason</name>
<avatar>https://via.placeholder.com/640x480.png/001144?text=nostrum</avatar>
<avatar>https://via.placeholder.com/640x480.png/002200?text=numquam</avatar>
<images name="tempora eos tenetur">https://via.placeholder.com/640x480.png/005544?text=consequatur</images>
<images name="excepturi fuga eligendi">https://via.placeholder.com/640x480.png/0011dd?text=maiores</images>
<name>Columbus Lesch</name>
<avatar>https://via.placeholder.com/640x480.png/005555?text=cupiditate</avatar>
<avatar>https://via.placeholder.com/640x480.png/00bb11?text=voluptatem</avatar>
<images name="omnis rem ipsam">https://via.placeholder.com/640x480.png/0033aa?text=et</images>
<images name="harum excepturi animi">https://via.placeholder.com/640x480.png/00bb66?text=et</images>
</user>

</array_directive>
10 changes: 5 additions & 5 deletions docs/snippets/advanced-directive-attributes.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<attributes_directive>

<company since="2018"/>
<company since="2015"/>
<url>https://example.com</url>

<user>
<name>Doyle Donnelly</name>
<contact email="adolphus.emard@example.net" phone="555-000-1"/>
<name>Mr. Jameson King I</name>
<contact email="upton.marcel@example.net" phone="555-000-1"/>
</user>
<user>
<name>Sally Pagac Sr.</name>
<contact email="walsh.tyree@example.org" phone="555-000-2"/>
<name>Gino Gutkowski</name>
<contact email="jeichmann@example.org" phone="555-000-2"/>
</user>

</attributes_directive>
8 changes: 4 additions & 4 deletions docs/snippets/advanced-directive-cdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<cdata_directive>

<user>
<name><![CDATA[<h1>Sallie Price</h1>]]></name>
<email>ssporer@example.net</email>
<name><![CDATA[<h1>Jose Lind</h1>]]></name>
<email>hegmann.gayle@example.com</email>
</user>
<user>
<name><![CDATA[<h1>Dr. Nedra Weimann</h1>]]></name>
<email>beau.feest@example.net</email>
<name><![CDATA[<h1>Damion Will</h1>]]></name>
<email>florida48@example.net</email>
</user>

</cdata_directive>
8 changes: 4 additions & 4 deletions docs/snippets/advanced-directive-mixed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<mixed_directive>

<user>
<name>Bradley Krajcik</name>
<name>Merl Fay</name>
<some>
<first>Foo</first>
<second>alexander73@example.net</second>
<second>estella13@example.net</second>
</some>
</user>
<user>
<name>Jamil Hilpert PhD</name>
<name>Brennan Kunze PhD</name>
<some>
<first>Foo</first>
<second>vwalsh@example.net</second>
<second>halvorson.oren@example.org</second>
</some>
</user>

Expand Down
8 changes: 4 additions & 4 deletions docs/snippets/advanced-directive-value.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<value_directive>

<user>
<name>Mr. Cyril Douglas</name>
<contact type="email">grant.kassulke@example.com</contact>
<name>Mr. Clemens Rosenbaum</name>
<contact type="email">zieme.peggie@example.com</contact>
</user>
<user>
<name>Prof. Camille Veum DVM</name>
<contact type="email">hfranecki@example.com</contact>
<name>Tamara Bode Sr.</name>
<contact type="email">franecki.macy@example.net</contact>
</user>

</value_directive>
8 changes: 4 additions & 4 deletions docs/snippets/advanced-element-attribute.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<attribute>

<user created_at="2025-09-16T13:25:14+00:00">
<user created_at="2025-10-31T23:00:54+00:00">
<id>1</id>
<name>Efren Prosacco</name>
<name>Walton Schinner</name>
</user>
<user created_at="2025-09-16T13:25:14+00:00">
<user created_at="2025-10-31T23:00:54+00:00">
<id>2</id>
<name>Elwyn Kuphal DDS</name>
<name>Lance Hagenes</name>
</user>

</attribute>
4 changes: 2 additions & 2 deletions docs/snippets/advanced-element-header-footer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

<user>
<id>1</id>
<name>Arnaldo Mohr</name>
<name>Dr. Bryce Schmitt Jr.</name>
</user>
<user>
<id>2</id>
<name>Dillan Beahan</name>
<name>Elfrieda Rippin PhD</name>
</user>

</header_footer>
Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/advanced-element-info-before-false.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

<user>
<id>1</id>
<name>Hilton Rath</name>
<name>Minnie Hoppe DDS</name>
</user>
<user>
<id>2</id>
<name>Prof. Juanita Oberbrunner</name>
<name>Monica Jakubowski DDS</name>
</user>

</info_method>
4 changes: 2 additions & 2 deletions docs/snippets/advanced-element-info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

<user>
<id>1</id>
<name>Sigurd Mueller</name>
<name>Alexandrea Jacobson</name>
</user>
<user>
<id>2</id>
<name>Kiera Hansen</name>
<name>Skye Stehr</name>
</user>

</info_method>
4 changes: 2 additions & 2 deletions docs/snippets/advanced-element-root.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

<user>
<id>1</id>
<name>Darby Davis MD</name>
<name>Twila Bartell</name>
</user>
<user>
<id>2</id>
<name>Dr. Mattie Rippin</name>
<name>Aurore Abbott</name>
</user>

</foo>
4 changes: 2 additions & 2 deletions docs/snippets/receipt-instagram-feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<g:id>1</g:id>
<g:title><![CDATA[Some 1]]></g:title>
<g:description><![CDATA[Some description 1]]></g:description>
<g:link>https://example.com/products/ratione-minima-officia-adipisci-ratione-consectetur</g:link>
<g:link>https://example.com/products/voluptas-quaerat-voluptatem-est-omnis</g:link>
<g:image_link>https://via.placeholder.com/640x480.png/008877?text=repudiandae</g:image_link>
<g:additional_image_link>https://via.placeholder.com/640x480.png/008877?text=repudiandae</g:additional_image_link>
<g:brand>The Best</g:brand>
Expand All @@ -31,7 +31,7 @@
<g:id>2</g:id>
<g:title><![CDATA[Some 2]]></g:title>
<g:description><![CDATA[Some description 2]]></g:description>
<g:link>https://example.com/products/accusamus-animi-animi-earum-quis</g:link>
<g:link>https://example.com/products/libero-dolores-natus-laborum-enim-enim-officiis</g:link>
<g:image_link>https://via.placeholder.com/640x480.png/009966?text=beatae</g:image_link>
<g:additional_image_link>https://via.placeholder.com/640x480.png/009966?text=beatae</g:additional_image_link>
<g:additional_image_link>https://via.placeholder.com/640x480.png/000011?text=deleniti</g:additional_image_link>
Expand Down
13 changes: 11 additions & 2 deletions docs/snippets/receipt-rss-feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<guid>1</guid>
<description><![CDATA[Some content 1]]></description>
<category>Some category 1</category>
<pubDate>Wed, 03 Sep 2025 13:26:59 +0000</pubDate>
<pubDate>Thu, 04 Sep 2025 00:18:36 +0000</pubDate>
<foo>bar</foo>
</item>
<item>
Expand All @@ -17,7 +17,16 @@
<guid>2</guid>
<description><![CDATA[Some content 2]]></description>
<category>Some category 2</category>
<pubDate>Wed, 03 Sep 2025 14:17:03 +0000</pubDate>
<pubDate>Wed, 03 Sep 2025 12:49:54 +0000</pubDate>
<foo>bar</foo>
</item>
<item>
<title>Some 3</title>
<link>https://example.com/news/some-3</link>
<guid>3</guid>
<description><![CDATA[Some content 3]]></description>
<category>Some category 3</category>
<pubDate>Wed, 03 Sep 2025 20:10:14 +0000</pubDate>
<foo>bar</foo>
</item>

Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/receipt-sitemap-feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">

<url>
<loc>https://example.com/products/dolor-culpa-reiciendis-illo-magnam-nisi-quisquam-labore-aspernatur</loc>
<loc>https://example.com/products/eaque-quo-autem-ipsum-omnis-et</loc>
<lastmod>2025-08-31T20:00:00+00:00</lastmod>
<priority>0.9</priority>
</url>
<url>
<loc>https://example.com/products/quas-tempora-quia-animi-veniam-tempore-et-at</loc>
<loc>https://example.com/products/aut-iusto-magnam-quae-est-aut</loc>
<lastmod>2025-08-30T19:00:00+00:00</lastmod>
<priority>0.9</priority>
</url>
Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/receipt-yandex-feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<offers>

<offer id="1" available="true" type="vendor.model">
<url>https://example.com/products/ipsa-maiores-odit-dicta-temporibus-et-rerum</url>
<url>https://example.com/products/aliquid-odio-enim-facilis-ducimus-voluptas</url>
<barcode>GD-PRDCT-1</barcode>
<name>Some 1</name>
<description>Some description 1</description>
Expand All @@ -29,7 +29,7 @@
<foo>bar</foo>
</offer>
<offer id="2" available="true" type="vendor.model">
<url>https://example.com/products/quo-rerum-qui-eos-eius-quaerat-voluptatem-et</url>
<url>https://example.com/products/corporis-id-unde-magni-omnis-atque</url>
<barcode>GD-PRDCT-2</barcode>
<name>Some 2</name>
<description>Some description 2</description>
Expand Down
30 changes: 28 additions & 2 deletions src/Feeds/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ public function chunkSize(): int
return 1000;
}

public function perFile(): int
{
return 0;
}

public function maxFiles(): int
{
return 0;
}

public function header(): string
{
return match ($this->format()) {
Expand Down Expand Up @@ -87,10 +97,26 @@ public function filename(): string
->toString();
}

public function path(): string
public function path(int|string $suffix = ''): string
{
if (empty($suffix)) {
return $this->storage()->path(
$this->filename()
);
}

$filename = $this->filename();

$directory = pathinfo($filename, PATHINFO_DIRNAME);
$basename = pathinfo($filename, PATHINFO_FILENAME);
$extension = pathinfo($filename, PATHINFO_EXTENSION);

if ($suffix) {
$suffix = '-' . $suffix;
}

return $this->storage()->path(
$this->filename()
"$directory/$basename$suffix.$extension"
);
}

Expand Down
Loading