From d5ed22eb4e7295837a423a17e1a41871be3d0448 Mon Sep 17 00:00:00 2001 From: Robert Kummer Date: Fri, 25 Aug 2023 17:20:11 +0200 Subject: [PATCH 1/2] updated dependency --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 26232dc..7356d8d 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ }, "require": { "php": ">=7.1", - "psr/log": "^1.1" + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "require-dev": { "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", From 3b2dc7423697daae0a78a5c6033561d2a4c79789 Mon Sep 17 00:00:00 2001 From: Robert Kummer Date: Fri, 25 Aug 2023 17:24:50 +0200 Subject: [PATCH 2/2] Remove '>' that prematurely closed the tag if adding dateCreated during encoding. --- src/Encoder/NetscapeBookmarkEncoder.php | 2 +- tests/Unit/Encoder/NetscapeBookmarkEncoderTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Encoder/NetscapeBookmarkEncoder.php b/src/Encoder/NetscapeBookmarkEncoder.php index 2a00e63..4f3d4b7 100644 --- a/src/Encoder/NetscapeBookmarkEncoder.php +++ b/src/Encoder/NetscapeBookmarkEncoder.php @@ -72,7 +72,7 @@ public function encode($data, array $context = []): string foreach ($tag['bookmarks'] as $bookmark) { $result .= sprintf('
ADD_DATE="%s"', $bookmark['dateCreated']); + $result .= sprintf(' ADD_DATE="%s"', $bookmark['dateCreated']); } if ($bookmark['public'] ?? null) { $result .= sprintf(' PRIVATE="%s"', $bookmark['public'] ? '0' : '1'); diff --git a/tests/Unit/Encoder/NetscapeBookmarkEncoderTest.php b/tests/Unit/Encoder/NetscapeBookmarkEncoderTest.php index 19d93e4..fbcc1e4 100644 --- a/tests/Unit/Encoder/NetscapeBookmarkEncoderTest.php +++ b/tests/Unit/Encoder/NetscapeBookmarkEncoderTest.php @@ -13,7 +13,7 @@ class NetscapeBookmarkEncoderTest extends TestCase { // phpcs:disable Generic.Files.LineLength - public const EXPECTED = "\n\nBookmarks\n

Bookmarks

\n

\n

TangoMan

\n

\n

TangoMan.io\n
FullStack PHP Symfony / Javascript Vue.JS Web Developer with strong interest for Cybersecurity, DevOps and Agile methodology.\n
ADD_DATE=\"1612572000\" LAST_MODIFIED=\"1612572000\">TangoMan75\n<\DL>

\n<\DL>

\n"; + public const EXPECTED = "\n\nBookmarks\n

Bookmarks

\n

\n

TangoMan

\n

\n

TangoMan.io\n
FullStack PHP Symfony / Javascript Vue.JS Web Developer with strong interest for Cybersecurity, DevOps and Agile methodology.\n
TangoMan75\n<\DL>

\n<\DL>

\n"; // phpcs:enable /**