From a5e32a129bf7bb0795a093aed96c2b00e87c4c67 Mon Sep 17 00:00:00 2001 From: Gregor Morrill Date: Fri, 3 Feb 2023 17:06:10 -0800 Subject: [PATCH 1/6] Update dependencies Add composer.lock --- composer.json | 8 +- composer.lock | 1861 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1865 insertions(+), 4 deletions(-) create mode 100644 composer.lock diff --git a/composer.json b/composer.json index 65c865a..b26819a 100644 --- a/composer.json +++ b/composer.json @@ -2,12 +2,12 @@ "name": "gregorlove/mf2-to-icalendar", "description": "Convert microformats h-event to iCalendar", "require": { - "php": ">=5.6.0", - "mf2/mf2": "^0.4", - "barnabywalters/mf-cleaner": "^0.1.4" + "php": ">=7.4", + "mf2/mf2": "^0.5", + "barnabywalters/mf-cleaner": "^0.2" }, "require-dev": { - "phpunit/phpunit": "^5" + "phpunit/phpunit": "^9" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..d95be3e --- /dev/null +++ b/composer.lock @@ -0,0 +1,1861 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "c0fe33f21132669de8ee605c73a428fd", + "packages": [ + { + "name": "barnabywalters/mf-cleaner", + "version": "v0.2.0", + "source": { + "type": "git", + "url": "https://github.com/barnabywalters/php-mf-cleaner.git", + "reference": "bf86945ccb24093294bd266ee9e874917e762680" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barnabywalters/php-mf-cleaner/zipball/bf86945ccb24093294bd266ee9e874917e762680", + "reference": "bf86945ccb24093294bd266ee9e874917e762680", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "~9", + "vimeo/psalm": "~4" + }, + "suggest": { + "mf2/mf2": "To parse microformats2 structures from (X)HTML" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barnaby Walters", + "email": "barnaby@waterpigs.co.uk" + } + ], + "description": "Cleans up microformats2 array structures", + "support": { + "issues": "https://github.com/barnabywalters/php-mf-cleaner/issues", + "source": "https://github.com/barnabywalters/php-mf-cleaner/tree/v0.2.0" + }, + "time": "2022-11-15T20:04:09+00:00" + }, + { + "name": "mf2/mf2", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/microformats/php-mf2.git", + "reference": "ddc56de6be62ed4a21f569de9b80e17af678ca50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microformats/php-mf2/zipball/ddc56de6be62ed4a21f569de9b80e17af678ca50", + "reference": "ddc56de6be62ed4a21f569de9b80e17af678ca50", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "mf2/tests": "dev-master#e9e2b905821ba0a5b59dab1a8eaf40634ce9cd49", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.6.2" + }, + "suggest": { + "barnabywalters/mf-cleaner": "To more easily handle the canonical data php-mf2 gives you", + "masterminds/html5": "Alternative HTML parser for PHP, for better HTML5 support." + }, + "bin": [ + "bin/fetch-mf2", + "bin/parse-mf2" + ], + "type": "library", + "autoload": { + "files": [ + "Mf2/Parser.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "CC0-1.0" + ], + "authors": [ + { + "name": "Barnaby Walters", + "homepage": "http://waterpigs.co.uk" + } + ], + "description": "A pure, generic microformats2 parser ā€” makes HTML as easy to consume as a JSON API", + "keywords": [ + "html", + "microformats", + "microformats 2", + "parser", + "semantic" + ], + "support": { + "issues": "https://github.com/microformats/php-mf2/issues", + "source": "https://github.com/microformats/php-mf2/tree/v0.5.0" + }, + "time": "2022-02-10T01:05:27+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2022-03-03T13:19:32+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.15.3", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + }, + "time": "2023-01-16T22:05:37+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.24", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.14", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-01-26T08:26:55+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "9a52e8385f3e432d7e8ecab72c4d211a67223285" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9a52e8385f3e432d7e8ecab72c4d211a67223285", + "reference": "9a52e8385f3e432d7e8ecab72c4d211a67223285", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.1" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2023-02-03T19:31:30+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T06:03:37+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-14T08:28:10+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.4" + }, + "platform-dev": [], + "plugin-api-version": "2.3.0" +} From 2f7085381d98c60ae83fcfd4675611df40103f8e Mon Sep 17 00:00:00 2001 From: Gregor Morrill Date: Fri, 3 Feb 2023 17:09:08 -0800 Subject: [PATCH 2/6] Fix fatal error when mf2 parse fails --- src/GregorMorrill/Mf2toiCal/Mf2toiCal.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php b/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php index de7dc1b..73a48fd 100644 --- a/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php +++ b/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php @@ -71,12 +71,14 @@ public function __get($name) } /** - * This method converts h-event microformats to iCalendar - * @access public + * Convert h-event microformats to iCalendar */ - public function convert() + public function convert(): void { - $microformats = Mf2\fetch($this->url); + // mf2 parsing can return null if not an HTML document. + // use null coalesce operator to ensure $microformats + // is always an array + $microformats = Mf2\fetch($this->url) ?? []; $events = Mf2helper\findMicroformatsByType($microformats, 'h-event'); $lines = []; From 691e74d64a4583e0c93659914490bc4f43e26021 Mon Sep 17 00:00:00 2001 From: Gregor Morrill Date: Fri, 3 Feb 2023 17:10:38 -0800 Subject: [PATCH 3/6] Add strict typing and type declarations --- src/GregorMorrill/Mf2toiCal/Mf2toiCal.php | 38 ++++++++--------------- src/GregorMorrill/Mf2toiCal/functions.php | 13 +++++--- tests/Mf2toiCalTest.php | 4 ++- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php b/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php index 73a48fd..f820147 100644 --- a/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php +++ b/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php @@ -1,4 +1,7 @@ url = $url; $this->lang = $lang; $this->charset = $charset; @@ -158,20 +156,16 @@ public function convert(): void /** * Format iCalendar property name - * @param string $name - * @return string */ - public function format_property($name) + public function format_property(string $name): string { return sprintf('%s;LANGUAGE=%s;CHARSET=%s:', $name, $this->lang, $this->charset); } /** * Format iCalendar dtstamp content line - * @param string $input - * @return string */ - public function format_dtstamp($input) + public function format_dtstamp(string $input): string { if ( !$dtstamp = $this->format_date($input) ) @@ -184,10 +178,8 @@ public function format_dtstamp($input) /** * Format iCalendar date value - * @param string $input - * @return string */ - public function format_date($input) + public function format_date(string $input): string { if ( !$input ) @@ -215,10 +207,8 @@ public function format_date($input) /** * Escape iCalendar text content lines - * @param string $input - * @return string */ - public function text($input) + public function text(string $input): string { $output = str_replace('\\', '\\\\', $input); $output = str_replace(';', '\\;', $output); @@ -229,10 +219,8 @@ public function text($input) /** * Fold iCalendar content lines - * @param string $input - * @return string */ - public function fold($input) + public function fold(string $input): string { $bc = strlen($input); $index = 0; diff --git a/src/GregorMorrill/Mf2toiCal/functions.php b/src/GregorMorrill/Mf2toiCal/functions.php index 6ff4142..be08df3 100644 --- a/src/GregorMorrill/Mf2toiCal/functions.php +++ b/src/GregorMorrill/Mf2toiCal/functions.php @@ -1,14 +1,17 @@ convert(); } diff --git a/tests/Mf2toiCalTest.php b/tests/Mf2toiCalTest.php index 912ea77..7a4cc6f 100644 --- a/tests/Mf2toiCalTest.php +++ b/tests/Mf2toiCalTest.php @@ -1,8 +1,10 @@ Date: Thu, 29 Feb 2024 20:10:18 -0800 Subject: [PATCH 4/6] Replace usage of join Use implode with parameters in correct order. --- src/GregorMorrill/Mf2toiCal/Mf2toiCal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php b/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php index f820147..8c4aed0 100644 --- a/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php +++ b/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php @@ -242,7 +242,7 @@ public function fold(string $input): string $lines[] = $line; } - return join($lines, "\r\n\t"); + return implode("\r\n\t", $lines); } } From ac338d28c23a400d197845e53b572cf92ae425cf Mon Sep 17 00:00:00 2001 From: Gregor Morrill Date: Thu, 29 Feb 2024 20:22:25 -0800 Subject: [PATCH 5/6] Code cleanup --- src/GregorMorrill/Mf2toiCal/Mf2toiCal.php | 437 ++++++++++------------ tests/Mf2toiCalTest.php | 206 +++++----- 2 files changed, 310 insertions(+), 333 deletions(-) diff --git a/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php b/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php index 8c4aed0..c06d967 100644 --- a/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php +++ b/src/GregorMorrill/Mf2toiCal/Mf2toiCal.php @@ -11,239 +11,216 @@ mb_internal_encoding('UTF-8'); -if ( !defined('PRODID_DOMAIN') ) -{ - define('PRODID_DOMAIN', 'example.com'); +if (!defined('PRODID_DOMAIN')) { + define('PRODID_DOMAIN', 'example.com'); } class Mf2toiCal { - /** - * @var string - */ - private $version = '0.0.3'; - - /** - * @var string - */ - private $url; - - /** - * @var string - */ - private $lang; - - /** - * @var string - */ - private $charset; - - public function __construct( - string $url, - string $lang = 'en', - string $charset = 'utf-8' - ) { - $this->url = $url; - $this->lang = $lang; - $this->charset = $charset; - } - - /** - * Get Mf2toiCal property - */ - public function __get($name) - { - - if ( isset($this->$name) ) - { - return $this->$name; - } - - $trace = debug_backtrace(); - trigger_error( - 'Undefined property via __get(): ' . $name . - ' in ' . $trace[0]['file'] . - ' on line ' . $trace[0]['line'], - E_USER_NOTICE); - return null; - } - - /** - * Convert h-event microformats to iCalendar - */ - public function convert(): void - { - // mf2 parsing can return null if not an HTML document. - // use null coalesce operator to ensure $microformats - // is always an array - $microformats = Mf2\fetch($this->url) ?? []; - $events = Mf2helper\findMicroformatsByType($microformats, 'h-event'); - - $lines = []; - $lines[] = 'BEGIN:VCALENDAR'; - $lines[] = sprintf('PRODID:-//%s//mf2 to iCalendar %s//EN', PRODID_DOMAIN, $this->version); - $lines[] = 'VERSION:2.0'; - $lines[] = 'METHOD:PUBLISH'; - - foreach ( $events as $event ) - { - $lines[] = 'BEGIN:VEVENT'; - - # mf2 has a u-url, update $this->url - if ( Mf2helper\hasProp($event, 'url') ) - { - $this->url = Mf2helper\getPlaintext($event, 'url'); - } - - # mf2 has u-uid, use it - if ( Mf2helper\hasProp($event, 'uid') ) - { - $lines[] = $this->fold( 'UID:' . Mf2helper\getPlaintext($event, 'uid') ); - } - # fallback to $this->url - else - { - $lines[] = $this->fold( 'UID:' . $this->url ); - } - - $lines[] = $this->fold( 'URL:' . $this->url ); - $lines[] = $this->format_dtstamp( Mf2helper\getPlaintext($event, 'published') ); - $lines[] = 'DTSTART:' . $this->format_date( Mf2helper\getPlaintext($event, 'start') ); - - if ( Mf2helper\hasProp($event, 'end') ) - { - $lines[] = 'DTEND:' . $this->format_date( Mf2helper\getPlaintext($event, 'end') ); - } - - $lines[] = $this->fold( $this->format_property('SUMMARY') . $this->text(Mf2helper\getPlaintext($event, 'name')) ); - - $property = $this->format_property('DESCRIPTION'); - - # mf2 has `content` property, use it - if ( Mf2helper\hasProp($event, 'content') ) - { - $lines[] = $this->fold( $property . $this->text(Mf2helper\getPlaintext($event, 'content')) ); - } - # mf2 has description property, use it - else if ( Mf2helper\hasProp($event, 'description') ) - { - $lines[] = $this->fold( $property . $this->text(Mf2helper\getPlaintext($event, 'description')) ); - } - # mf2 has summary property, use it as fallback description - else if ( Mf2helper\hasProp($event, 'summary') ) - { - $lines[] = $this->fold( $property . $this->text(Mf2helper\getPlaintext($event, 'summary')) ); - } - - # mf2 has a location, use it - if ( Mf2helper\hasProp($event, 'location') ) - { - $lines[] = $this->fold( $this->format_property('LOCATION') . $this->text(Mf2helper\getPlaintext($event, 'location')) ); - } - - $lines[] = 'END:VEVENT'; - } - - $lines[] = 'END:VCALENDAR'; - - // header('Content-Type: text/plain; charset=utf8'); - header('Content-Disposition: attachment; filename=calendar.ics'); - header('Connection: close'); - header('Content-Type: text/calendar; charset=utf8; name=calendar.ics'); - echo implode("\r\n", array_filter($lines)); - exit; - } - - /** - * Format iCalendar property name - */ - public function format_property(string $name): string - { - return sprintf('%s;LANGUAGE=%s;CHARSET=%s:', $name, $this->lang, $this->charset); - } - - /** - * Format iCalendar dtstamp content line - */ - public function format_dtstamp(string $input): string - { - - if ( !$dtstamp = $this->format_date($input) ) - { - $dtstamp = $this->format_date('now'); - } - - return 'DTSTAMP:' . $dtstamp; - } - - /** - * Format iCalendar date value - */ - public function format_date(string $input): string - { - - if ( !$input ) - { - return ''; - } - - $parsed = date_parse($input); - $has_timezone = ( isset($parsed['zone']) ) ? true : false; - - # datetime string has timezone - if ( $has_timezone ) - { - $date = new DateTime($input); - $date->setTimezone(new DateTimeZone('UTC')); - return $date->format('Ymd\THis\Z'); - } - else - { - $date = new DateTime($input); - return $date->format('Ymd\THis'); - } - - } - - /** - * Escape iCalendar text content lines - */ - public function text(string $input): string - { - $output = str_replace('\\', '\\\\', $input); - $output = str_replace(';', '\\;', $output); - $output = str_replace(',', '\\,', $output); - $output = str_replace(["\r\n", "\n"], '\n', $output); - return trim($output); - } - - /** - * Fold iCalendar content lines - */ - public function fold(string $input): string - { - $bc = strlen($input); - $index = 0; - $lines = []; - - if ( $bc <= 75 ) - { - return $input; - } - - while ( $bc > 0 ) - { - $cut_length = ( $index == 0 ) ? 75 : 74; - $line = mb_strcut($input, $index, $cut_length); - $length = strlen($line); - $index += $length; - $bc -= $length; - - $lines[] = $line; - } - - return implode("\r\n\t", $lines); - } - + /** + * @var string + */ + private $version = '0.0.4'; + + /** + * @var string + */ + private $url; + + /** + * @var string + */ + private $lang; + + /** + * @var string + */ + private $charset; + + public function __construct( + string $url, + string $lang = 'en', + string $charset = 'utf-8' + ) { + $this->url = $url; + $this->lang = $lang; + $this->charset = $charset; + } + + /** + * Get Mf2toiCal property + */ + public function __get($name) + { + if (isset($this->$name)) { + return $this->$name; + } + + $trace = debug_backtrace(); + trigger_error( + 'Undefined property via __get(): ' . $name . + ' in ' . $trace[0]['file'] . + ' on line ' . $trace[0]['line'], + E_USER_NOTICE); + return null; + } + + /** + * Convert h-event microformats to iCalendar + */ + public function convert(): void + { + // mf2 parsing can return null if not an HTML document. + // use null coalesce operator to ensure $microformats + // is always an array + $microformats = Mf2\fetch($this->url) ?? []; + $events = Mf2helper\findMicroformatsByType($microformats, 'h-event'); + + $lines = []; + $lines[] = 'BEGIN:VCALENDAR'; + $lines[] = sprintf('PRODID:-//%s//mf2 to iCalendar %s//EN', PRODID_DOMAIN, $this->version); + $lines[] = 'VERSION:2.0'; + $lines[] = 'METHOD:PUBLISH'; + + foreach ($events as $event) { + $lines[] = 'BEGIN:VEVENT'; + + # mf2 has a u-url, update $this->url + if (Mf2helper\hasProp($event, 'url')) { + $this->url = Mf2helper\getPlaintext($event, 'url'); + } + + # mf2 has u-uid, use it + if (Mf2helper\hasProp($event, 'uid')) { + $lines[] = $this->fold( 'UID:' . Mf2helper\getPlaintext($event, 'uid') ); + } else { + # fallback to $this->url + $lines[] = $this->fold( 'UID:' . $this->url ); + } + + $lines[] = $this->fold( 'URL:' . $this->url ); + $lines[] = $this->format_dtstamp( Mf2helper\getPlaintext($event, 'published') ); + $lines[] = 'DTSTART:' . $this->format_date( Mf2helper\getPlaintext($event, 'start') ); + + if (Mf2helper\hasProp($event, 'end')) { + $lines[] = 'DTEND:' . $this->format_date( Mf2helper\getPlaintext($event, 'end') ); + } + + $lines[] = $this->fold( $this->format_property('SUMMARY') . $this->text(Mf2helper\getPlaintext($event, 'name')) ); + + $property = $this->format_property('DESCRIPTION'); + + # mf2 has `content` property, use it + if (Mf2helper\hasProp($event, 'content')) { + $lines[] = $this->fold( $property . $this->text(Mf2helper\getPlaintext($event, 'content')) ); + } elseif (Mf2helper\hasProp($event, 'description')) { + # mf2 has description property, use it + $lines[] = $this->fold( $property . $this->text(Mf2helper\getPlaintext($event, 'description')) ); + } elseif (Mf2helper\hasProp($event, 'summary')) { + # mf2 has summary property, use it as fallback description + $lines[] = $this->fold( $property . $this->text(Mf2helper\getPlaintext($event, 'summary')) ); + } + + # mf2 has a location, use it + if (Mf2helper\hasProp($event, 'location')) { + $lines[] = $this->fold( $this->format_property('LOCATION') . $this->text(Mf2helper\getPlaintext($event, 'location')) ); + } + + $lines[] = 'END:VEVENT'; + } + + $lines[] = 'END:VCALENDAR'; + + header('Content-Disposition: attachment; filename=calendar.ics'); + header('Connection: close'); + header('Content-Type: text/calendar; charset=utf8; name=calendar.ics'); + echo implode("\r\n", array_filter($lines)); + exit; + } + + /** + * Format iCalendar property name + */ + public function format_property(string $name): string + { + return sprintf('%s;LANGUAGE=%s;CHARSET=%s:', + $name, + $this->lang, + $this->charset + ); + } + + /** + * Format iCalendar dtstamp content line + */ + public function format_dtstamp(string $input): string + { + if (!($dtstamp = $this->format_date($input))) { + $dtstamp = $this->format_date('now'); + } + + return 'DTSTAMP:' . $dtstamp; + } + + /** + * Format iCalendar date value + */ + public function format_date(string $input): string + { + if (!$input) { + return ''; + } + + $parsed = date_parse($input); + $has_timezone = ( isset($parsed['zone']) ) ? true : false; + + # datetime string has timezone + if ($has_timezone) { + $date = new DateTime($input); + $date->setTimezone(new DateTimeZone('UTC')); + return $date->format('Ymd\THis\Z'); + } else { + $date = new DateTime($input); + return $date->format('Ymd\THis'); + } + } + + /** + * Escape iCalendar text content lines + */ + public function text(string $input): string + { + $output = str_replace('\\', '\\\\', $input); + $output = str_replace(';', '\\;', $output); + $output = str_replace(',', '\\,', $output); + $output = str_replace(["\r\n", "\n"], '\n', $output); + return trim($output); + } + + /** + * Fold iCalendar content lines + */ + public function fold(string $input): string + { + $bc = strlen($input); + $index = 0; + $lines = []; + + if ($bc <= 75) { + return $input; + } + + while ($bc > 0) { + $cut_length = ($index == 0) ? 75 : 74; + $line = mb_strcut($input, $index, $cut_length); + $length = strlen($line); + $index += $length; + $bc -= $length; + + $lines[] = $line; + } + + return implode("\r\n\t", $lines); + } } diff --git a/tests/Mf2toiCalTest.php b/tests/Mf2toiCalTest.php index 7a4cc6f..6182337 100644 --- a/tests/Mf2toiCalTest.php +++ b/tests/Mf2toiCalTest.php @@ -8,109 +8,109 @@ final class Mf2toiCalTest extends TestCase { - public function testConstructorDefaults() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $this->assertEquals('http://example.com', $Mf2toiCal->url); - $this->assertEquals('en', $Mf2toiCal->lang); - $this->assertEquals('utf-8', $Mf2toiCal->charset); - } - - public function testConstructorCustom() - { - $Mf2toiCal = new Mf2toiCal('http://example.de', 'de', 'utf-16'); - $this->assertEquals('http://example.de', $Mf2toiCal->url); - $this->assertEquals('de', $Mf2toiCal->lang); - $this->assertEquals('utf-16', $Mf2toiCal->charset); - } - - public function testConstructorLanguageOnly() - { - $Mf2toiCal = new Mf2toiCal('http://example.com', 'sv'); - $this->assertEquals('http://example.com', $Mf2toiCal->url); - $this->assertEquals('sv', $Mf2toiCal->lang); - $this->assertEquals('utf-8', $Mf2toiCal->charset); - } - - public function testFormatProperty() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $property = $Mf2toiCal->format_property('SUMMARY'); - $this->assertEquals('SUMMARY;LANGUAGE=en;CHARSET=utf-8:', $property); - } - - public function testFormatDateWithTimezone() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $date = $Mf2toiCal->format_date('2018-03-29 06:20:00-0800'); - $this->assertEquals('20180329T142000Z', $date); - } - - public function testFormatDateWithoutTimezone() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $date = $Mf2toiCal->format_date('2018-03-29 07:20:00'); - $this->assertEquals('20180329T072000', $date); - } - - public function testFormatDtstamp() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $date = $Mf2toiCal->format_dtstamp('2018-03-29 18:20:00-0500'); - $this->assertEquals('DTSTAMP:20180329T232000Z', $date); - } - - public function testTextEscapeBackslashes() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $text = $Mf2toiCal->text('this\that'); - $this->assertEquals('this\\\\that', $text); - } - - public function testTextEscapeSemicolons() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $text = $Mf2toiCal->text('this; then that'); - $this->assertEquals('this\; then that', $text); - } - - public function testTextEscapeCommas() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $text = $Mf2toiCal->text('this, that'); - $this->assertEquals('this\, that', $text); - } - - public function testTextNormalizeCRLF() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $text = $Mf2toiCal->text("this\r\nthat"); - $this->assertEquals('this\nthat', $text); - } - - public function testFold75Bytes() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $folded = $Mf2toiCal->fold('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet sed.'); - $this->assertEquals('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet sed.', $folded); - } - - public function testFoldMoreThan75Bytes() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $folded = $Mf2toiCal->fold('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc porttitor neque non nibh auctor metus.'); - $this->assertEquals("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc porttitor neq\r\n\tue non nibh auctor metus.", $folded); - } - - /** - * 'Lorem ipsum' text is 74 bytes. Poop emoji is 4 bytes. - */ - public function testFoldMultibyteCharacters() - { - $Mf2toiCal = new Mf2toiCal('http://example.com'); - $folded = $Mf2toiCal->fold('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et posuere.šŸ’©'); - $this->assertEquals("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et posuere.\r\n\tšŸ’©", $folded); - } + public function testConstructorDefaults(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $this->assertEquals('http://example.com', $Mf2toiCal->url); + $this->assertEquals('en', $Mf2toiCal->lang); + $this->assertEquals('utf-8', $Mf2toiCal->charset); + } + + public function testConstructorCustom(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.de', 'de', 'utf-16'); + $this->assertEquals('http://example.de', $Mf2toiCal->url); + $this->assertEquals('de', $Mf2toiCal->lang); + $this->assertEquals('utf-16', $Mf2toiCal->charset); + } + + public function testConstructorLanguageOnly(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com', 'sv'); + $this->assertEquals('http://example.com', $Mf2toiCal->url); + $this->assertEquals('sv', $Mf2toiCal->lang); + $this->assertEquals('utf-8', $Mf2toiCal->charset); + } + + public function testFormatProperty(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $property = $Mf2toiCal->format_property('SUMMARY'); + $this->assertEquals('SUMMARY;LANGUAGE=en;CHARSET=utf-8:', $property); + } + + public function testFormatDateWithTimezone(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $date = $Mf2toiCal->format_date('2018-03-29 06:20:00-0800'); + $this->assertEquals('20180329T142000Z', $date); + } + + public function testFormatDateWithoutTimezone(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $date = $Mf2toiCal->format_date('2018-03-29 07:20:00'); + $this->assertEquals('20180329T072000', $date); + } + + public function testFormatDtstamp(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $date = $Mf2toiCal->format_dtstamp('2018-03-29 18:20:00-0500'); + $this->assertEquals('DTSTAMP:20180329T232000Z', $date); + } + + public function testTextEscapeBackslashes(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $text = $Mf2toiCal->text('this\that'); + $this->assertEquals('this\\\\that', $text); + } + + public function testTextEscapeSemicolons(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $text = $Mf2toiCal->text('this; then that'); + $this->assertEquals('this\; then that', $text); + } + + public function testTextEscapeCommas(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $text = $Mf2toiCal->text('this, that'); + $this->assertEquals('this\, that', $text); + } + + public function testTextNormalizeCRLF(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $text = $Mf2toiCal->text("this\r\nthat"); + $this->assertEquals('this\nthat', $text); + } + + public function testFold75Bytes(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $folded = $Mf2toiCal->fold('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet sed.'); + $this->assertEquals('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet sed.', $folded); + } + + public function testFoldMoreThan75Bytes(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $folded = $Mf2toiCal->fold('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc porttitor neque non nibh auctor metus.'); + $this->assertEquals("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc porttitor neq\r\n\tue non nibh auctor metus.", $folded); + } + + /** + * 'Lorem ipsum' text is 74 bytes. Poop emoji is 4 bytes. + */ + public function testFoldMultibyteCharacters(): void + { + $Mf2toiCal = new Mf2toiCal('http://example.com'); + $folded = $Mf2toiCal->fold('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et posuere.šŸ’©'); + $this->assertEquals("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et posuere.\r\n\tšŸ’©", $folded); + } } From f95516eaf5b100955dd4e12c73bc62bba957ff02 Mon Sep 17 00:00:00 2001 From: Gregor Morrill Date: Thu, 29 Feb 2024 20:27:08 -0800 Subject: [PATCH 6/6] Update readme --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 98abcf6..1b09b49 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Convert microformats [h-event](https://microformats.org/wiki/h-event) to iCalend Note: This is currently very much an _alpha_ version, doing the minimal amount I needed it to do. I plan to expand it, though. Issue reports are welcomed. ## Requirements -* PHP 5.6+ +* PHP 7.4+ * [php-mf2](https://github.com/indieweb/php-mf2) - included via Composer * [php-mf-cleaner](https://github.com/barnabywalters/php-mf-cleaner) - included via Composer @@ -22,7 +22,7 @@ It is recommended to install via [Composer](https://getcomposer.org/). This proj } ], "require": { - "gregorlove/mf2-to-icalendar": "dev-master" + "gregorlove/mf2-to-icalendar": "dev-main" } } @@ -68,10 +68,6 @@ define('PRODID_DOMAIN', 'example.com'); Mf2toiCal\convert('https://example.com/event'); ``` -### Exceptions - -If the specified URL does not have h-event microformats, an Exception is thrown. Your code should be set up to handle that Exception. - ### Language and Character Set This script defaults to language `en` and charset `utf-8` for text content lines in the generated .ics file. You can specify different options when calling `convert()`: @@ -85,6 +81,12 @@ Detecting the language from the HTML and using that is on my TODO list. ## Changelog +### 0.0.4 +2024-02-29 +* Update dependencies +* Add type declarations and strict typing +* Fix errors + ### 0.0.3 2020-12-23 * No longer throws an Exception if no h-event microformats found when converting. Instead will generate an "empty" iCalendar.