From 5b76b5f4ceeedb88c18a0d5911d0fde022444e01 Mon Sep 17 00:00:00 2001 From: christophe Date: Fri, 13 Aug 2021 16:42:44 +0200 Subject: [PATCH 1/3] support for Php 8 --- composer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 25b7cfa..0cdb8ec 100644 --- a/composer.json +++ b/composer.json @@ -16,10 +16,12 @@ } ], "require": { - "php": "^7.0" + "php": "^7.4 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.0", + "spatie/phpunit-snapshot-assertions": "^4.0", + "vimeo/psalm": "^4.7" }, "autoload": { From 97cfc5187bded2b9d2a8de8181f4ffc0d620a38d Mon Sep 17 00:00:00 2001 From: christophe Date: Sun, 29 Aug 2021 14:46:45 +0200 Subject: [PATCH 2/3] Update Ics.php --- src/Generators/Ics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generators/Ics.php b/src/Generators/Ics.php index 0835528..333e02d 100644 --- a/src/Generators/Ics.php +++ b/src/Generators/Ics.php @@ -14,7 +14,7 @@ class Ics implements Generator protected $uid = null; protected $only_string; - public function __construct($uid = null, $only_string) + public function __construct($uid = null, $only_string = false) { $this->uid = $uid; $this->only_string = $only_string; From 09808bf93f88ee55d497e017cc719f0b158cd8ca Mon Sep 17 00:00:00 2001 From: christophe Date: Thu, 2 Jun 2022 15:41:52 +0200 Subject: [PATCH 3/3] Update ICS to remove glue --- src/Generators/Ics.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Generators/Ics.php b/src/Generators/Ics.php index 333e02d..e25358c 100644 --- a/src/Generators/Ics.php +++ b/src/Generators/Ics.php @@ -79,12 +79,12 @@ public function generate(Link $link): string $url[] = 'TRANSP:OPAQUE'; $url[] = 'END:VEVENT'; $url[] = 'END:VCALENDAR'; - $redirectLink = implode('%0d%0a', $url); + if($this->only_string) - return $redirectLink; + return implode('%0d%0a', $url); else - return 'data:text/calendar;charset=utf8,'.$redirectLink; + return implode("\n", $url); } /** @see https://tools.ietf.org/html/rfc5545.html#section-3.3.11 */