From 2c84b3d4d565e02094d9a621ce979326139c5633 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Mar 2023 12:46:14 -0400 Subject: [PATCH 01/14] update: Depenencies --- composer.lock | 166 ++++++++++++++++++++++++++------------------------ 1 file changed, 85 insertions(+), 81 deletions(-) diff --git a/composer.lock b/composer.lock index 827fe30..fd0a19f 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "8fold/php-xml-builder", - "version": "1.3.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/8fold/php-xml-builder.git", - "reference": "1d6f19717721de9a67e06f572ce6da2180685ebd" + "reference": "d189ea5ece18ef957d6ffac9b1dadd0033bc4ab6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/8fold/php-xml-builder/zipball/1d6f19717721de9a67e06f572ce6da2180685ebd", - "reference": "1d6f19717721de9a67e06f572ce6da2180685ebd", + "url": "https://api.github.com/repos/8fold/php-xml-builder/zipball/d189ea5ece18ef957d6ffac9b1dadd0033bc4ab6", + "reference": "d189ea5ece18ef957d6ffac9b1dadd0033bc4ab6", "shasum": "" }, "require": { @@ -47,7 +47,7 @@ "description": "A library for building XML document and element strings.", "support": { "issues": "https://github.com/8fold/php-xml-builder/issues", - "source": "https://github.com/8fold/php-xml-builder/tree/1.3.0" + "source": "https://github.com/8fold/php-xml-builder/tree/1.5.0" }, "funding": [ { @@ -59,36 +59,36 @@ "type": "github" } ], - "time": "2022-11-19T20:30:22+00:00" + "time": "2022-12-11T03:07:11+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^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.22" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -115,7 +115,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -131,20 +131,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -182,7 +182,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -190,20 +190,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.2", + "version": "v4.15.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "shasum": "" }, "require": { @@ -244,9 +244,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" }, - "time": "2022-11-12T15:38:23+00:00" + "time": "2023-03-05T19:49:14+00:00" }, { "name": "phar-io/manifest", @@ -361,16 +361,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.2", + "version": "1.10.8", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" + "reference": "0166aef76e066f0dd2adc2799bdadfa1635711e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0166aef76e066f0dd2adc2799bdadfa1635711e9", + "reference": "0166aef76e066f0dd2adc2799bdadfa1635711e9", "shasum": "" }, "require": { @@ -399,8 +399,11 @@ "static analysis" ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.2" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -416,27 +419,27 @@ "type": "tidelift" } ], - "time": "2022-11-10T09:56:11+00:00" + "time": "2023-03-24T10:28:16+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.19", + "version": "9.2.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559" + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -451,8 +454,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -485,7 +488,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" }, "funding": [ { @@ -493,7 +496,7 @@ "type": "github" } ], - "time": "2022-11-18T07:47:47+00:00" + "time": "2023-03-06T12:58:08+00:00" }, { "name": "phpunit/php-file-iterator", @@ -738,20 +741,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.26", + "version": "9.6.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2" + "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/851867efcbb6a1b992ec515c71cdcf20d895e9d2", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -780,8 +783,8 @@ "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -789,7 +792,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -820,7 +823,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.26" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5" }, "funding": [ { @@ -836,7 +839,7 @@ "type": "tidelift" } ], - "time": "2022-10-28T06:00:21+00:00" + "time": "2023-03-09T06:34:10+00:00" }, { "name": "sebastian/cli-parser", @@ -1204,16 +1207,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -1255,7 +1258,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -1263,7 +1266,7 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", @@ -1577,16 +1580,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -1625,10 +1628,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "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.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -1636,7 +1639,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -1695,16 +1698,16 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -1739,7 +1742,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -1747,7 +1750,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -1804,16 +1807,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -1849,14 +1852,15 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "theseer/tokenizer", From e80b207f4c1b4180d0c57a2fe2d58966b032a5c5 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Mar 2023 14:35:25 -0400 Subject: [PATCH 02/14] update: PHPUnit --- composer.json | 6 +- composer.lock | 592 ++++++++++++++++++++------------------------------ phpunit.xml | 8 +- 3 files changed, 238 insertions(+), 368 deletions(-) diff --git a/composer.json b/composer.json index 23c3468..bcebef0 100644 --- a/composer.json +++ b/composer.json @@ -15,11 +15,11 @@ }, "require": { "php": "^8.1", - "8fold/php-xml-builder": "^1.3" + "8fold/php-xml-builder": "^2.0" }, "require-dev": { - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.0", "squizlabs/php_codesniffer": "^3.7" }, "autoload": { diff --git a/composer.lock b/composer.lock index fd0a19f..fe69676 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "982fc4e06d562b88cbccf101ab53362b", + "content-hash": "aa852b08d41a4471d21e9aeafb488a90", "packages": [ { "name": "8fold/php-xml-builder", - "version": "1.5.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/8fold/php-xml-builder.git", - "reference": "d189ea5ece18ef957d6ffac9b1dadd0033bc4ab6" + "reference": "a1feffe8d91e3ed3bf532c9b2ba13c5a8c2abfcb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/8fold/php-xml-builder/zipball/d189ea5ece18ef957d6ffac9b1dadd0033bc4ab6", - "reference": "d189ea5ece18ef957d6ffac9b1dadd0033bc4ab6", + "url": "https://api.github.com/repos/8fold/php-xml-builder/zipball/a1feffe8d91e3ed3bf532c9b2ba13c5a8c2abfcb", + "reference": "a1feffe8d91e3ed3bf532c9b2ba13c5a8c2abfcb", "shasum": "" }, "require": { @@ -47,7 +47,7 @@ "description": "A library for building XML document and element strings.", "support": { "issues": "https://github.com/8fold/php-xml-builder/issues", - "source": "https://github.com/8fold/php-xml-builder/tree/1.5.0" + "source": "https://github.com/8fold/php-xml-builder/tree/2.0.0" }, "funding": [ { @@ -59,80 +59,10 @@ "type": "github" } ], - "time": "2022-12-11T03:07:11+00:00" + "time": "2022-12-11T03:40:44+00:00" } ], "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^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/2.0.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:23:10+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.11.1", @@ -423,16 +353,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "10.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/20800e84296ea4732f9a125e08ce86b4004ae3e4", + "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4", "shasum": "" }, "require": { @@ -440,18 +370,18 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.15", - "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", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -460,7 +390,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.0-dev" } }, "autoload": { @@ -488,7 +418,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.2" }, "funding": [ { @@ -496,32 +426,32 @@ "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-03-06T13:00:19+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", + "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -548,7 +478,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" }, "funding": [ { @@ -556,28 +486,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-02-10T16:53:14+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -585,7 +515,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -611,7 +541,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -619,32 +549,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -670,7 +600,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" }, "funding": [ { @@ -678,32 +608,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-02-03T06:56:46+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -729,7 +659,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -737,24 +667,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.5", + "version": "10.0.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5" + "reference": "582563ed2edc62d1455cdbe00ea49fe09428eef3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/582563ed2edc62d1455cdbe00ea49fe09428eef3", + "reference": "582563ed2edc62d1455cdbe00ea49fe09428eef3", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -764,27 +693,26 @@ "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" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.0", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.0", + "sebastian/global-state": "^6.0", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -792,7 +720,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.0-dev" } }, "autoload": { @@ -823,7 +751,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.18" }, "funding": [ { @@ -839,32 +768,32 @@ "type": "tidelift" } ], - "time": "2023-03-09T06:34:10+00:00" + "time": "2023-03-22T06:15:31+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -887,7 +816,7 @@ "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" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" }, "funding": [ { @@ -895,32 +824,32 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2023-02-03T06:58:15+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -943,7 +872,7 @@ "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" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -951,32 +880,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -998,7 +927,7 @@ "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" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -1006,34 +935,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1072,7 +1003,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" }, "funding": [ { @@ -1080,33 +1011,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2023-02-03T07:07:16+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1129,7 +1060,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" }, "funding": [ { @@ -1137,33 +1068,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-02-03T06:59:47+00:00" }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", + "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1195,7 +1126,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" }, "funding": [ { @@ -1203,27 +1135,27 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-03-23T05:12:41+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc", + "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -1231,7 +1163,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1250,7 +1182,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -1258,7 +1190,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.0" }, "funding": [ { @@ -1266,34 +1198,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2023-02-03T07:03:04+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1335,7 +1267,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" }, "funding": [ { @@ -1343,38 +1275,35 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2023-02-03T07:06:49+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "aab257c712de87b90194febd52e4d184551c2d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", + "reference": "aab257c712de87b90194febd52e4d184551c2d44", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1399,7 +1328,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" }, "funding": [ { @@ -1407,33 +1336,33 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-02-03T07:07:38+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -1456,7 +1385,7 @@ "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" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" }, "funding": [ { @@ -1464,34 +1393,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-02-03T07:08:02+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1513,7 +1442,7 @@ "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" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -1521,32 +1450,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1568,7 +1497,7 @@ "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" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -1576,32 +1505,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1631,62 +1560,7 @@ "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" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -1694,32 +1568,32 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1742,7 +1616,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -1750,29 +1624,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1795,7 +1669,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -1803,7 +1677,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "squizlabs/php_codesniffer", diff --git a/phpunit.xml b/phpunit.xml index 4b019cd..2826b84 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,16 +1,13 @@ + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" + backupStaticProperties="false"> ./src/ @@ -28,5 +25,4 @@ - From 87851c336655fdf275eb53a5a1e1055fb913ba7e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 24 Sep 2023 13:43:40 -0400 Subject: [PATCH 03/14] deprecate: Using buildable contract --- src/Atom/Author.php | 11 +- src/Atom/Authors.php | 59 ++++- src/Atom/Categories.php | 59 ++++- src/Atom/Category.php | 10 +- src/Atom/Content.php | 17 +- src/Atom/Contributor.php | 11 +- src/Atom/Contributors.php | 59 ++++- src/{DocumentAtom.php => Atom/Document.php} | 59 ++--- src/Atom/Entries.php | 59 ++++- src/Atom/Entry.php | 33 +-- src/Atom/Enums/LinkRel.php | 13 -- src/Atom/Enums/TextTypes.php | 11 - src/Atom/Generator.php | 9 +- src/Atom/Link.php | 27 ++- src/Atom/Links.php | 59 ++++- src/Atom/Rights.php | 23 +- src/Atom/Subtitle.php | 23 +- src/Atom/Summary.php | 18 +- src/Atom/{Abstracts => }/TextElement.php | 19 +- src/Atom/TextTypes.php | 11 + src/Atom/Title.php | 17 +- src/Implementations/CollectionImp.php | 68 ------ .../CollectionJsonSerializableImp.php | 16 -- .../CollectionStringableImp.php | 25 -- src/Implementations/DocumentImp.php | 24 -- src/Json/Attachment.php | 41 +++- src/Json/Attachments.php | 44 +++- src/Json/Author.php | 47 +++- src/Json/Authors.php | 44 +++- src/Json/ContentHtml.php | 18 +- src/Json/CustomObject.php | 10 +- src/Json/CustomObjects.php | 44 +++- src/{DocumentJson.php => Json/Document.php} | 59 ++--- src/Json/Hub.php | 24 +- src/Json/Hubs.php | 44 +++- src/Json/Item.php | 52 +++-- src/Json/Items.php | 44 +++- src/Rss/Categories.php | 59 ++++- src/Rss/Category.php | 9 +- src/Rss/Cloud.php | 23 +- src/{DocumentRss.php => Rss/Document.php} | 68 +++--- src/Rss/Enclosure.php | 9 +- src/Rss/Enums/CloudProtocol.php | 11 - src/Rss/Enums/SkipDaysDay.php | 15 -- src/Rss/Guid.php | 9 +- src/Rss/Image.php | 4 +- src/Rss/Item.php | 30 ++- src/Rss/Items.php | 57 ++++- src/Rss/SkipDays.php | 20 +- src/Rss/SkipHours.php | 10 +- src/Rss/Source.php | 9 +- src/Rss/TextInput.php | 9 +- tests/Atom/AtomTest.php | 24 +- tests/Atom/{sample-01.xml => samples/01.xml} | 0 tests/Json/JsonFeedTest.php | 114 --------- tests/Json/MainTest.php | 221 ++++++++++++++++++ .../Json/{sample-01.json => samples/01.json} | 0 .../Json/{sample-02.json => samples/02.json} | 0 .../Json/{sample-03.json => samples/03.json} | 0 tests/Json/samples/extended.json | 24 ++ tests/Rss/CloudTest.php | 4 +- tests/Rss/RssTest.php | 24 +- tests/Rss/SkipDaysTest.php | 17 +- tests/Rss/{sample-01.xml => samples/01.xml} | 0 tests/Rss/{ => samples}/required-01.xml | 0 tests/Rss/{ => samples}/required-02.xml | 0 66 files changed, 1234 insertions(+), 747 deletions(-) rename src/{DocumentAtom.php => Atom/Document.php} (84%) delete mode 100644 src/Atom/Enums/LinkRel.php delete mode 100644 src/Atom/Enums/TextTypes.php rename src/Atom/{Abstracts => }/TextElement.php (58%) create mode 100644 src/Atom/TextTypes.php delete mode 100644 src/Implementations/CollectionImp.php delete mode 100644 src/Implementations/CollectionJsonSerializableImp.php delete mode 100644 src/Implementations/CollectionStringableImp.php delete mode 100644 src/Implementations/DocumentImp.php rename src/{DocumentJson.php => Json/Document.php} (68%) rename src/{DocumentRss.php => Rss/Document.php} (84%) delete mode 100644 src/Rss/Enums/CloudProtocol.php delete mode 100644 src/Rss/Enums/SkipDaysDay.php rename tests/Atom/{sample-01.xml => samples/01.xml} (100%) delete mode 100644 tests/Json/JsonFeedTest.php create mode 100644 tests/Json/MainTest.php rename tests/Json/{sample-01.json => samples/01.json} (100%) rename tests/Json/{sample-02.json => samples/02.json} (100%) rename tests/Json/{sample-03.json => samples/03.json} (100%) create mode 100644 tests/Json/samples/extended.json rename tests/Rss/{sample-01.xml => samples/01.xml} (100%) rename tests/Rss/{ => samples}/required-01.xml (100%) rename tests/Rss/{ => samples}/required-02.xml (100%) diff --git a/src/Atom/Author.php b/src/Atom/Author.php index 029bb19..1082a3d 100644 --- a/src/Atom/Author.php +++ b/src/Atom/Author.php @@ -4,13 +4,12 @@ namespace Eightfold\Syndication\Atom; use Stringable; -use DateTime; -use Eightfold\XMLBuilder\Contracts\Buildable; +use DateTime; use Eightfold\XMLBuilder\Element; -class Author implements Buildable +class Author implements Stringable { public static function create( string $name, @@ -27,16 +26,12 @@ final private function __construct( ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { $uri = (strlen($this->uri) === 0) ? '' : Element::uri($this->uri); $email = (strlen($this->email) === 0) ? '' : Element::email($this->email); + return (string) Element::author( Element::name($this->name), $uri, diff --git a/src/Atom/Authors.php b/src/Atom/Authors.php index 6de5692..f7e2578 100644 --- a/src/Atom/Authors.php +++ b/src/Atom/Authors.php @@ -6,16 +6,15 @@ use Traversable; use Iterator; use Countable; - -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; use Eightfold\Syndication\Atom\Author; -use Eightfold\Syndication\Implementations\CollectionStringableImp; - -class Authors implements Traversable, Iterator, Countable, Buildable +class Authors implements Traversable, Iterator, Countable, Stringable { - use CollectionStringableImp; + private array $collection = []; + + private int $position = 0; public static function create(Author ...$authors): self { @@ -26,4 +25,52 @@ final private function __construct(Author ...$authors) { $this->collection = $authors; } + + /** Stringable **/ + public function __toString(): string + { + $compiled = ''; + foreach ($this->collection as $c) { + $compiled .= strval($c); + } + return $compiled; + } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Atom/Categories.php b/src/Atom/Categories.php index 9099468..87779af 100644 --- a/src/Atom/Categories.php +++ b/src/Atom/Categories.php @@ -6,16 +6,15 @@ use Traversable; use Iterator; use Countable; - -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; use Eightfold\Syndication\Atom\Category; -use Eightfold\Syndication\Implementations\CollectionStringableImp; - -class Categories implements Traversable, Iterator, Countable, Buildable +class Categories implements Traversable, Iterator, Countable, Stringable { - use CollectionStringableImp; + private array $collection = []; + + private int $position = 0; public static function create(Category ...$categories): self { @@ -26,4 +25,52 @@ final private function __construct(Category ...$categories) { $this->collection = $categories; } + + /** Stringable **/ + public function __toString(): string + { + $compiled = ''; + foreach ($this->collection as $c) { + $compiled .= strval($c); + } + return $compiled; + } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Atom/Category.php b/src/Atom/Category.php index 7ec85a9..e370e25 100644 --- a/src/Atom/Category.php +++ b/src/Atom/Category.php @@ -4,13 +4,12 @@ namespace Eightfold\Syndication\Atom; use Stringable; -use DateTime; -use Eightfold\XMLBuilder\Contracts\Buildable; +use DateTime; use Eightfold\XMLBuilder\Element; -class Category implements Buildable +class Category implements Stringable { public static function create( string $term, @@ -27,11 +26,6 @@ final private function __construct( ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { $props = [ diff --git a/src/Atom/Content.php b/src/Atom/Content.php index 80189ba..40063b8 100644 --- a/src/Atom/Content.php +++ b/src/Atom/Content.php @@ -3,32 +3,27 @@ namespace Eightfold\Syndication\Atom; -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; -use Eightfold\Syndication\Atom\Abstracts\TextElement; +use Eightfold\Syndication\Atom\TextElement; -use Eightfold\Syndication\Atom\Enums\TextTypes; +use Eightfold\Syndication\Atom\TextTypes; -class Content implements Buildable +class Content implements Stringable { public static function create( string $content, - TextTypes $type = TextTypes::TEXT + string $type = TextTypes::TEXT ): self { return new self($content, $type); } final private function __construct( readonly private string $content, - readonly private TextTypes $type + readonly private string $type ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { return (string) TextElement::create( diff --git a/src/Atom/Contributor.php b/src/Atom/Contributor.php index 0a2fe55..f7a0ddd 100644 --- a/src/Atom/Contributor.php +++ b/src/Atom/Contributor.php @@ -4,13 +4,12 @@ namespace Eightfold\Syndication\Atom; use Stringable; -use DateTime; -use Eightfold\XMLBuilder\Contracts\Buildable; +use DateTime; use Eightfold\XMLBuilder\Element; -class Contributor implements Buildable +class Contributor implements Stringable { public static function create( string $name, @@ -27,16 +26,12 @@ final private function __construct( ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { $uri = (strlen($this->uri) === 0) ? '' : Element::uri($this->uri); $email = (strlen($this->email) === 0) ? '' : Element::email($this->email); + return (string) Element::contributor( Element::name($this->name), $uri, diff --git a/src/Atom/Contributors.php b/src/Atom/Contributors.php index 3adef79..1d0de2d 100644 --- a/src/Atom/Contributors.php +++ b/src/Atom/Contributors.php @@ -6,16 +6,15 @@ use Traversable; use Iterator; use Countable; - -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; use Eightfold\Syndication\Atom\Contributor; -use Eightfold\Syndication\Implementations\CollectionStringableImp; - -class Contributors implements Traversable, Iterator, Countable, Buildable +class Contributors implements Traversable, Iterator, Countable, Stringable { - use CollectionStringableImp; + private array $collection = []; + + private int $position = 0; public static function create(Contributor ...$contributors): self { @@ -26,4 +25,52 @@ final private function __construct(Contributor ...$contributors) { $this->collection = $contributors; } + + /** Stringable **/ + public function __toString(): string + { + $compiled = ''; + foreach ($this->collection as $c) { + $compiled .= strval($c); + } + return $compiled; + } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/DocumentAtom.php b/src/Atom/Document.php similarity index 84% rename from src/DocumentAtom.php rename to src/Atom/Document.php index f06ef4d..09acab7 100644 --- a/src/DocumentAtom.php +++ b/src/Atom/Document.php @@ -1,18 +1,15 @@ xmlVersion = strval($version); + $this->xmlEncoding = $encoding; + $this->xmlStandalone = $standalone; + return $this; + } + public function withCategories(Categories $categories): self { $this->categories = $categories; @@ -177,11 +189,6 @@ private function isInvalid(): bool return ! $this->isValid(); } - public function build(): string - { - return strval($this); - } - public function __toString(): string { if ($this->isInvalid()) { @@ -200,7 +207,7 @@ public function __toString(): string $categories = ''; if ( - $this->categories !== null and + isset($this->categories) and $this->categories->count() > 0 ) { $categories = $this->categories; @@ -208,14 +215,14 @@ public function __toString(): string $contributors = ''; if ( - $this->contributors !== null and + isset($this->contributors) and $this->contributors->count() > 0 ) { $contributors = $this->contributors; } $generator = ''; - if ($this->generator !== null) { + if (isset($this->generator)) { $generator = $this->generator; } @@ -230,12 +237,12 @@ public function __toString(): string } $rights = ''; - if ($this->rights !== null) { + if (isset($this->rights)) { $rights = $this->rights; } $subtitle = ''; - if ($this->subtitle !== null) { + if (isset($this->subtitle)) { $subtitle = $this->subtitle; } @@ -258,10 +265,10 @@ public function __toString(): string $this->entries )->props('xmlns ' . self::VERSION); - $doc = $doc->setVersion($this->xmlVersion); + $doc = $doc->withVersion($this->xmlVersion); if (strlen($this->xmlEncoding) > 0) { - $doc = $doc->setEncoding($this->xmlEncoding); + $doc = $doc->withEncoding($this->xmlEncoding); } else { $doc = $doc->removeEncoding(); @@ -269,7 +276,7 @@ public function __toString(): string } if (is_bool($this->xmlStandalone)) { - $doc = $doc->setStandalone($this->xmlStandalone); + $doc = $doc->withStandalone($this->xmlStandalone); } else { $doc = $doc->removeStandalone(); diff --git a/src/Atom/Entries.php b/src/Atom/Entries.php index a3614dd..efe1aac 100644 --- a/src/Atom/Entries.php +++ b/src/Atom/Entries.php @@ -6,16 +6,15 @@ use Traversable; use Iterator; use Countable; - -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; use Eightfold\Syndication\Atom\Entry; -use Eightfold\Syndication\Implementations\CollectionStringableImp; - -class Entries implements Traversable, Iterator, Countable, Buildable +class Entries implements Traversable, Iterator, Countable, Stringable { - use CollectionStringableImp; + private array $collection = []; + + private int $position = 0; public static function create(Entry ...$entries): self { @@ -40,4 +39,52 @@ public function isValid(): bool } return true; } + + /** Stringable **/ + public function __toString(): string + { + $compiled = ''; + foreach ($this->collection as $c) { + $compiled .= strval($c); + } + return $compiled; + } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Atom/Entry.php b/src/Atom/Entry.php index 5a2348a..08601bc 100644 --- a/src/Atom/Entry.php +++ b/src/Atom/Entry.php @@ -4,9 +4,10 @@ namespace Eightfold\Syndication\Atom; use Stringable; + use DateTime; -use Eightfold\XMLBuilder\Contracts\Buildable; +// use Eightfold\XMLBuilder\Contracts\Buildable; use Eightfold\XMLBuilder\Element; @@ -21,17 +22,17 @@ use Eightfold\Syndication\Atom\Categories; -class Entry implements Buildable +class Entry implements Stringable { - private ?Categories $categories = null; + private Categories $categories; - private ?Contributors $contributors = null; + private Contributors $contributors; - private ?DateTime $published = null; + private DateTime $published; - private ?Rights $rights = null; + private Rights $rights; - private ?Subtitle $subtitle = null; + private Subtitle $subtitle; public static function create( Title $title, @@ -141,49 +142,49 @@ public function __toString(): string } $authors = ''; - if ($this->authors !== null) { + if (isset($this->authors)) { $authors = $this->authors; } $content = ''; - if ($this->content !== null) { + if (isset($this->content)) { $content = $this->content; } $links = ''; - if ($this->links !== null) { + if (isset($this->links)) { $links = $this->links; } $summary = ''; - if ($this->summary !== null) { + if (isset($this->summary)) { $summary = $this->summary; } $categories = ''; - if ($this->categories !== null) { + if (isset($this->categories)) { $categories = $this->categories; } $contributors = ''; - if ($this->contributors !== null) { + if (isset($this->contributors)) { $contributors = $this->contributors; } $published = ''; - if ($this->published !== null) { + if (isset($this->published)) { $published = Element::published( $this->published->format(DateTime::ATOM) ); } $rights = ''; - if ($this->rights !== null) { + if (isset($this->rights)) { $rights = $this->rights; } $subtitle = ''; - if ($this->subtitle !== null) { + if (isset($this->subtitle)) { $subtitle = $this->subtitle; } diff --git a/src/Atom/Enums/LinkRel.php b/src/Atom/Enums/LinkRel.php deleted file mode 100644 index 770f8d3..0000000 --- a/src/Atom/Enums/LinkRel.php +++ /dev/null @@ -1,13 +0,0 @@ -content); diff --git a/src/Atom/Link.php b/src/Atom/Link.php index 9bfeae1..d605a27 100644 --- a/src/Atom/Link.php +++ b/src/Atom/Link.php @@ -3,47 +3,46 @@ namespace Eightfold\Syndication\Atom; -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; use Eightfold\XMLBuilder\Element; -use Eightfold\Syndication\Atom\Enums\LinkRel; - -class Link implements Buildable +class Link implements Stringable { + const ALTERNATE = 'alternate'; + const ENCLOSURE = 'enclosure'; + const RELATED = 'related'; + const SELF = 'self'; + const VIA = 'via'; + public static function create( string $href, - LinkRel $rel = LinkRel::ALTERNATE + string $rel = Link::ALTERNATE ): self { return new self($href, $rel); } final private function __construct( readonly private string $href, - readonly private LinkRel $rel + readonly private string $rel ) { } public function isAlternate(): bool { - return $this->rel === LinkRel::ALTERNATE; - } - - public function build(): string - { - return strval($this); + return $this->rel === Link::ALTERNATE; } public function __toString(): string { - if ($this->rel === LinkRel::ALTERNATE) { + if ($this->rel === Link::ALTERNATE) { return (string) Element::link()->omitEndTag()->props( 'href ' . $this->href, ); } return (string) Element::link()->omitEndTag()->props( 'href ' . $this->href, - 'rel ' . $this->rel->value + 'rel ' . $this->rel ); } } diff --git a/src/Atom/Links.php b/src/Atom/Links.php index d940bd1..ac75ecb 100644 --- a/src/Atom/Links.php +++ b/src/Atom/Links.php @@ -6,16 +6,15 @@ use Traversable; use Iterator; use Countable; - -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; use Eightfold\Syndication\Atom\Link; -use Eightfold\Syndication\Implementations\CollectionStringableImp; - -class Links implements Traversable, Iterator, Countable, Buildable +class Links implements Traversable, Iterator, Countable, Stringable { - use CollectionStringableImp; + private array $collection = []; + + private int $position = 0; public static function create(Link ...$links): self { @@ -26,4 +25,52 @@ final private function __construct(Link ...$links) { $this->collection = $links; } + + /** Stringable **/ + public function __toString(): string + { + $compiled = ''; + foreach ($this->collection as $c) { + $compiled .= strval($c); + } + return $compiled; + } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Atom/Rights.php b/src/Atom/Rights.php index 009a245..476f84b 100644 --- a/src/Atom/Rights.php +++ b/src/Atom/Rights.php @@ -3,33 +3,32 @@ namespace Eightfold\Syndication\Atom; -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; -use Eightfold\Syndication\Atom\Abstracts\TextElement; -use Eightfold\Syndication\Atom\Enums\TextTypes; +use Eightfold\Syndication\Atom\TextElement; +use Eightfold\Syndication\Atom\TextTypes; -class Rights implements Buildable +class Rights implements Stringable { public static function create( string $content, - TextTypes $type = TextTypes::TEXT + string $type = TextTypes::TEXT ): self { return new self($content, $type); } final private function __construct( readonly private string $content, - readonly private TextTypes $type + readonly private string $type ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { - return (string) TextElement::create('rights', $this->content, $this->type); + return (string) TextElement::create( + 'rights', + $this->content, + $this->type + ); } } diff --git a/src/Atom/Subtitle.php b/src/Atom/Subtitle.php index cc690f7..3f9269d 100644 --- a/src/Atom/Subtitle.php +++ b/src/Atom/Subtitle.php @@ -3,33 +3,32 @@ namespace Eightfold\Syndication\Atom; -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; -use Eightfold\Syndication\Atom\Abstracts\TextElement; -use Eightfold\Syndication\Atom\Enums\TextTypes; +use Eightfold\Syndication\Atom\TextElement; +use Eightfold\Syndication\Atom\TextTypes; -class Subtitle implements Buildable +class Subtitle implements Stringable { public static function create( string $content, - TextTypes $type = TextTypes::TEXT + string $type = TextTypes::TEXT ): self { return new self($content, $type); } final private function __construct( readonly private string $content, - readonly private TextTypes $type + readonly private string $type ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { - return (string) TextElement::create('subtitle', $this->content, $this->type); + return (string) TextElement::create( + 'subtitle', + $this->content, + $this->type + ); } } diff --git a/src/Atom/Summary.php b/src/Atom/Summary.php index 320fb84..1b43a11 100644 --- a/src/Atom/Summary.php +++ b/src/Atom/Summary.php @@ -3,32 +3,26 @@ namespace Eightfold\Syndication\Atom; -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; -use Eightfold\Syndication\Atom\Abstracts\TextElement; +use Eightfold\Syndication\Atom\TextElement; +use Eightfold\Syndication\Atom\TextTypes; -use Eightfold\Syndication\Atom\Enums\TextTypes; - -class Summary implements Buildable +class Summary implements Stringable { public static function create( string $content, - TextTypes $type = TextTypes::TEXT + string $type = TextTypes::TEXT ): self { return new self($content, $type); } final private function __construct( readonly private string $content, - readonly private TextTypes $type + readonly private string $type ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { return (string) TextElement::create( diff --git a/src/Atom/Abstracts/TextElement.php b/src/Atom/TextElement.php similarity index 58% rename from src/Atom/Abstracts/TextElement.php rename to src/Atom/TextElement.php index 4af6cf0..ec30445 100644 --- a/src/Atom/Abstracts/TextElement.php +++ b/src/Atom/TextElement.php @@ -1,20 +1,20 @@ element}($this->content); if ($this->type === TextTypes::TEXT) { return (string) $e; } - return (string) $e->props('type ' . $this->type->value); + return (string) $e->props('type ' . $this->type); } } diff --git a/src/Atom/TextTypes.php b/src/Atom/TextTypes.php new file mode 100644 index 0000000..ef2bce7 --- /dev/null +++ b/src/Atom/TextTypes.php @@ -0,0 +1,11 @@ +collection as $c) { - $compiled .= strval($c); - } - return $compiled; - } - - /** - * @return array - */ - public function collection(): array - { - return $this->collection; - } - - /*********** Countable ***********/ - public function count(): int - { - return count($this->collection()); - } - - /*********** Iterator ***********/ - public function current(): object - { - $a = $this->collection(); - return $a[$this->position]; - } - - public function rewind(): void - { - $this->position = 0; - } - - public function key(): int|string - { - return $this->position; - } - - public function next(): void - { - ++$this->position; - } - - public function valid(): bool - { - $a = $this->collection(); - - return isset($a[$this->position]); - } -} diff --git a/src/Implementations/CollectionJsonSerializableImp.php b/src/Implementations/CollectionJsonSerializableImp.php deleted file mode 100644 index 7568386..0000000 --- a/src/Implementations/CollectionJsonSerializableImp.php +++ /dev/null @@ -1,16 +0,0 @@ -collection(); - } -} diff --git a/src/Implementations/CollectionStringableImp.php b/src/Implementations/CollectionStringableImp.php deleted file mode 100644 index d63c3f1..0000000 --- a/src/Implementations/CollectionStringableImp.php +++ /dev/null @@ -1,25 +0,0 @@ -collection as $c) { - $compiled .= strval($c); - } - return $compiled; - } -} diff --git a/src/Implementations/DocumentImp.php b/src/Implementations/DocumentImp.php deleted file mode 100644 index 061cdd2..0000000 --- a/src/Implementations/DocumentImp.php +++ /dev/null @@ -1,24 +0,0 @@ -xmlVersion = strval($version); - $this->xmlEncoding = $encoding; - $this->xmlStandalone = $standalone; - return $this; - } -} diff --git a/src/Json/Attachment.php b/src/Json/Attachment.php index a23b297..69fbd25 100644 --- a/src/Json/Attachment.php +++ b/src/Json/Attachment.php @@ -4,14 +4,20 @@ namespace Eightfold\Syndication\Json; use StdClass; +use Stringable; use JsonSerializable; +use Eightfold\Syndication\Json\CustomObjects; +use Eightfold\Syndication\Json\CustomObject; + class Attachment implements JsonSerializable { + private CusstomObjects $customObjects; + public static function create( - string $url, - string $mimeType, - string $title = '', + string|Stringable $url, + string|Stringable $mimeType, + string|Stringable $title = '', int $size = 0, int $duration = 0 ): self { @@ -19,15 +25,27 @@ public static function create( } final private function __construct( - readonly private string $url, - readonly private string $mimeType, - readonly private string $title = '', + readonly private string|Stringable $url, + readonly private string|Stringable $mimeType, + readonly private string|Stringable $title = '', readonly private int $size = 0, readonly private int $duration = 0 ) { } - public function jsonSerialize(): mixed + public function withCustomObjects(CustomObjects $customObjects): self + { + $this->customObjects = $customObjects; + return $this; + } + + public function withExtensions(CustomObjects $customObjects): self + { + return $this->withCustomObjects($customObjects); + } + + /** JsonSerializable **/ + public function jsonSerialize(): StdClass { $obj = new StdClass(); $obj->url = $this->url; @@ -45,6 +63,15 @@ public function jsonSerialize(): mixed $obj->duration_in_seconds = $this->duration; } + if (isset($this->customObjects)) { + foreach ($this->customObjects as $customObject) { + if (is_a($customObject, CustomObject::class)) { + $name = $customObject->name(); + $obj->{$name} = $customObject->object(); + } + } + } + return $obj; } } diff --git a/src/Json/Attachments.php b/src/Json/Attachments.php index 83f0c6d..b60d088 100644 --- a/src/Json/Attachments.php +++ b/src/Json/Attachments.php @@ -8,13 +8,13 @@ use Countable; use JsonSerializable; -use Eightfold\Syndication\Implementations\CollectionJsonSerializableImp; - use Eightfold\Syndication\Json\Attachment; class Attachments implements Traversable, Iterator, Countable, JsonSerializable { - use CollectionJsonSerializableImp; + private array $collection = []; + + private int $position = 0; public static function create(Attachment ...$attachments): self { @@ -25,4 +25,42 @@ final private function __construct(Attachment ...$attachments) { $this->collection = $attachments; } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Json/Author.php b/src/Json/Author.php index c19c3fb..9ec0c58 100644 --- a/src/Json/Author.php +++ b/src/Json/Author.php @@ -4,39 +4,66 @@ namespace Eightfold\Syndication\Json; use StdClass; +use Stringable; use JsonSerializable; +use Eightfold\Syndication\Json\CustomObjects; +use Eightfold\Syndication\Json\CustomObject; + class Author implements JsonSerializable { + private CusstomObjects $customObjects; + public static function create( - string $name = '', - string $url = '', - string $avatar = '' + string|Stringable $name = '', + string|Stringable $url = '', + string|Stringable $avatar = '' ): self { return new self($name, $url, $avatar); } final private function __construct( - readonly private string $name = '', - readonly private string $url = '', - readonly private string $avatar = '' + readonly private string|Stringable $name = '', + readonly private string|Stringable $url = '', + readonly private string|Stringable $avatar = '' ) { } - public function jsonSerialize(): mixed + public function withCustomObjects(CustomObjects $customObjects): self + { + $this->customObjects = $customObjects; + return $this; + } + + public function withExtensions(CustomObjects $customObjects): self + { + return $this->withCustomObjects($customObjects); + } + + /** JsonSerializable **/ + public function jsonSerialize(): StdClass { $obj = new StdClass(); if (strlen($this->name) > 0) { - $obj->name = $this->name; + $obj->name = (string) $this->name; } if (strlen($this->url) > 0) { - $obj->url = $this->url; + $obj->url = (string) $this->url; } if (strlen($this->avatar) > 0) { - $obj->avatar = $this->avatar; + $obj->avatar = (string) $this->avatar; + } + + if (isset($this->customObjects)) { + foreach ($this->customObjects as $customObject) { + if (is_a($customObject, CustomObject::class)) { + $name = $customObject->name(); + $obj->{$name} = $customObject->object(); + } + } } return $obj; diff --git a/src/Json/Authors.php b/src/Json/Authors.php index 4af6cf6..f444d15 100644 --- a/src/Json/Authors.php +++ b/src/Json/Authors.php @@ -8,13 +8,13 @@ use Countable; use JsonSerializable; -use Eightfold\Syndication\Implementations\CollectionJsonSerializableImp; - use Eightfold\Syndication\Json\Author; class Authors implements Traversable, Iterator, Countable, JsonSerializable { - use CollectionJsonSerializableImp; + private array $collection = []; + + private int $position = 0; public static function create(Author ...$authors): self { @@ -25,4 +25,42 @@ final private function __construct(Author ...$authors) { $this->collection = $authors; } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Json/ContentHtml.php b/src/Json/ContentHtml.php index 6d14c36..a6c5ecb 100644 --- a/src/Json/ContentHtml.php +++ b/src/Json/ContentHtml.php @@ -3,26 +3,22 @@ namespace Eightfold\Syndication\Json; -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; -class ContentHtml implements Buildable +class ContentHtml implements Stringable { - public static function create(string $content): self + public static function create(string|Stringable $content): self { return new self($content); } - final private function __construct(readonly private string $content) - { - } - - public function build(): string - { - return strval($this); + final private function __construct( + readonly private string|Stringable $content + ) { } public function __toString(): string { - return $this->content; + return (string) $this->content; } } diff --git a/src/Json/CustomObject.php b/src/Json/CustomObject.php index 353162b..f1ce2bb 100644 --- a/src/Json/CustomObject.php +++ b/src/Json/CustomObject.php @@ -4,17 +4,20 @@ namespace Eightfold\Syndication\Json; use StdClass; +use Stringable; use JsonSerializable; class CustomObject { - public static function create(string $name, StdClass $object): self - { + public static function create( + string|Stringable $name, + StdClass $object + ): self { return new self($name, $object); } final private function __construct( - readonly private string $name, + readonly private string|Stringable $name, readonly private StdClass $object ) { } @@ -36,6 +39,7 @@ public function object(): StdClass return $this->object; } + /** JsonSerializable **/ public function jsonSerialize(): mixed { $obj = new StdClass(); diff --git a/src/Json/CustomObjects.php b/src/Json/CustomObjects.php index 4fc07c1..e1a4e1a 100644 --- a/src/Json/CustomObjects.php +++ b/src/Json/CustomObjects.php @@ -8,13 +8,13 @@ use Countable; use JsonSerializable; -use Eightfold\Syndication\Implementations\CollectionJsonSerializableImp; - use Eightfold\Syndication\Json\CustomObject; class CustomObjects implements Traversable, Iterator, Countable, JsonSerializable { - use CollectionJsonSerializableImp; + private array $collection = []; + + private int $position = 0; public static function create(CustomObject ...$objects): self { @@ -25,4 +25,42 @@ final private function __construct(CustomObject ...$objects) { $this->collection = $objects; } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/DocumentJson.php b/src/Json/Document.php similarity index 68% rename from src/DocumentJson.php rename to src/Json/Document.php index 09bd1bc..2805dff 100644 --- a/src/DocumentJson.php +++ b/src/Json/Document.php @@ -1,9 +1,10 @@ description = $description; return $this; } - public function withUserComment(string $userComment): self + public function withUserComment(string|Stringable $userComment): self { $this->userComment = $userComment; return $this; } - public function withNextUrl(string $nextUrl): self + public function withNextUrl(string|Stringable $nextUrl): self { $this->nextUrl = $nextUrl; return $this; } - public function withIcon(string $icon): self + public function withIcon(string|Stringable $icon): self { $this->icon = $icon; return $this; } - public function withFavicon(string $favicon): self + public function withFavicon(string|Stringable $favicon): self { $this->favicon = $favicon; return $this; @@ -95,7 +96,7 @@ public function withAuthors(Authors $authors): self return $this; } - public function withLanguage(string $language): self + public function withLanguage(string|Stringable $language): self { $this->language = $language; return $this; @@ -119,6 +120,12 @@ public function withCustomObjects(CustomObjects $customObjects): self return $this; } + public function withExtensions(CustomObjects $customObjects): self + { + return $this->withCustomObjects($customObjects); + } + + /** JsonSerializable **/ public function jsonSerialize(): mixed { $obj = new StdClass(); @@ -153,7 +160,7 @@ public function jsonSerialize(): mixed $obj->favicon = $this->favicon; } - if ($this->authors !== null) { + if (isset($this->authors)) { $obj->authors = $this->authors; } @@ -165,13 +172,13 @@ public function jsonSerialize(): mixed $obj->expired = $this->isExpired; } - if ($this->hubs !== null) { + if (isset($this->hubs)) { $obj->hubs = $this->hubs; } $obj->items = $this->items; - if ($this->customObjects !== null) { + if (isset($this->customObjects)) { foreach ($this->customObjects as $customObject) { if (is_a($customObject, CustomObject::class)) { $name = $customObject->name(); diff --git a/src/Json/Hub.php b/src/Json/Hub.php index fe1b8d1..09d18a3 100644 --- a/src/Json/Hub.php +++ b/src/Json/Hub.php @@ -4,29 +4,43 @@ namespace Eightfold\Syndication\Json; use StdClass; +use Stringable; use JsonSerializable; +use Eightfold\Syndication\Json\CustomObjects; +use Eightfold\Syndication\Json\CustomObject; + class Hub implements JsonSerializable { public static function create( - string $type, - string $url + string|Stringable $type, + string|Stringable $url ): self { return new self($type, $url); } final private function __construct( - readonly private string $type, - readonly private string $url + readonly private string|Stringable $type, + readonly private string|Stringable $url ) { } - public function jsonSerialize(): mixed + /** JsonSerializable **/ + public function jsonSerialize(): StdClass { $obj = new StdClass(); $obj->type = $this->type; $obj->url = $this->url; + if (isset($this->customObjects)) { + foreach ($this->customObjects as $customObject) { + if (is_a($customObject, CustomObject::class)) { + $name = $customObject->name(); + $obj->{$name} = $customObject->object(); + } + } + } + return $obj; } } diff --git a/src/Json/Hubs.php b/src/Json/Hubs.php index 1e72422..989fd00 100644 --- a/src/Json/Hubs.php +++ b/src/Json/Hubs.php @@ -8,13 +8,13 @@ use Countable; use JsonSerializable; -use Eightfold\Syndication\Implementations\CollectionJsonSerializableImp; - use Eightfold\Syndication\Json\Hub; class Hubs implements Traversable, Iterator, Countable, JsonSerializable { - use CollectionJsonSerializableImp; + private array $collection = []; + + private int $position = 0; public static function create(Hub ...$hubs): self { @@ -25,4 +25,42 @@ final private function __construct(Hub ...$hubs) { $this->collection = $hubs; } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Json/Item.php b/src/Json/Item.php index 6d4cd2b..bf85023 100644 --- a/src/Json/Item.php +++ b/src/Json/Item.php @@ -5,6 +5,7 @@ use DateTime; use StdClass; +use Stringable; use JsonSerializable; use Eightfold\Syndication\Json\ContentHtml; @@ -19,7 +20,7 @@ */ class Item implements JsonSerializable { - private string|ContentHtml|null $extraContent = null; + private string|ContentHtml $extraContent; private string $url = ''; @@ -33,11 +34,11 @@ class Item implements JsonSerializable private string $bannerImage = ''; - private ?DateTime $datePublished = null; + private DateTime $datePublished; - private ?DateTime $dateModified = null; + private DateTime $dateModified; - private ?Authors $authors = null; + private Authors $authors; /** * @var string[] @@ -46,9 +47,9 @@ class Item implements JsonSerializable private string $language = ''; - private ?Attachments $attachments = null; + private Attachments $attachments; - private ?CustomObjects $customObjects = null; + private CustomObjects $customObjects; public static function create( string $id, @@ -63,43 +64,44 @@ final private function __construct( ) { } - public function withExtraContent(string|ContentHtml $extraContent): self - { + public function withExtraContent( + string|Stringable|ContentHtml $extraContent + ): self { $this->extraContent = $extraContent; return $this; } - public function withUrl(string $url): self + public function withUrl(string|Stringable $url): self { $this->url = $url; return $this; } - public function withExternalUrl(string $externalUrl): self + public function withExternalUrl(string|Stringable $externalUrl): self { $this->externalUrl = $externalUrl; return $this; } - public function withTitle(string $title): self + public function withTitle(string|Stringable $title): self { $this->title = $title; return $this; } - public function withSummary(string $summary): self + public function withSummary(string|Stringable $summary): self { $this->summary = $summary; return $this; } - public function withImage(string $image): self + public function withImage(string|Stringable $image): self { $this->image = $image; return $this; } - public function withBannerImage(string $bannerImage): self + public function withBannerImage(string|Stringable $bannerImage): self { $this->bannerImage = $bannerImage; return $this; @@ -123,13 +125,13 @@ public function withAuthors(Authors $authors): self return $this; } - public function withTags(string ...$tags): self + public function withTags(string|Stringable ...$tags): self { $this->tags = $tags; return $this; } - public function withLanguage(string $language): self + public function withLanguage(string|Stringable $language): self { $this->language = $language; return $this; @@ -147,6 +149,12 @@ public function withCustomObjects(CustomObjects $customObjects): self return $this; } + public function withExtensions(CustomObjects $customObjects): self + { + return $this->withCustomObjects($customObjects); + } + + /** JsonSerializable **/ public function jsonSerialize(): mixed { $obj = new StdClass(); @@ -175,7 +183,7 @@ public function jsonSerialize(): mixed } - if ($this->extraContent !== null) { + if (isset($this->extraContent)) { if ( is_object($this->extraContent) and is_a($this->extraContent, ContentHtml::class) @@ -200,15 +208,15 @@ public function jsonSerialize(): mixed $obj->banner_image = $this->bannerImage; } - if ($this->datePublished !== null) { + if (isset($this->datePublished)) { $obj->date_published = $this->datePublished->format(DateTime::ATOM); } - if ($this->dateModified !== null) { + if (isset($this->dateModified)) { $obj->date_modified = $this->dateModified->format(DateTime::ATOM); } - if ($this->authors !== null) { + if (isset($this->authors)) { $obj->authors = $this->authors; } @@ -220,11 +228,11 @@ public function jsonSerialize(): mixed $obj->language = $this->language; } - if ($this->attachments !== null) { + if (isset($this->attachments)) { $obj->attachments = $this->attachments; } - if ($this->customObjects !== null) { + if (isset($this->customObjects)) { foreach ($this->customObjects as $customObject) { if (is_a($customObject, CustomObject::class)) { $name = $customObject->name(); diff --git a/src/Json/Items.php b/src/Json/Items.php index 8577194..c4b594b 100644 --- a/src/Json/Items.php +++ b/src/Json/Items.php @@ -8,13 +8,13 @@ use Countable; use JsonSerializable; -use Eightfold\Syndication\Implementations\CollectionJsonSerializableImp; - use Eightfold\Syndication\Json\Item; class Items implements Traversable, Iterator, Countable, JsonSerializable { - use CollectionJsonSerializableImp; + private array $collection = []; + + private int $position = 0; public static function create(Item ...$items): self { @@ -25,4 +25,42 @@ final private function __construct(Item ...$items) { $this->collection = $items; } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Rss/Categories.php b/src/Rss/Categories.php index 088ca41..989763c 100644 --- a/src/Rss/Categories.php +++ b/src/Rss/Categories.php @@ -6,16 +6,15 @@ use Traversable; use Iterator; use Countable; - -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; use Eightfold\Syndication\Rss\Category; -use Eightfold\Syndication\Implementations\CollectionStringableImp; - -class Categories implements Traversable, Iterator, Countable, Buildable +class Categories implements Traversable, Iterator, Countable, Stringable { - use CollectionStringableImp; + private array $collection = []; + + private int $position = 0; public static function create(Category ...$categories): self { @@ -26,4 +25,52 @@ final private function __construct(Category ...$categories) { $this->collection = $categories; } + + /** Stringable **/ + public function __toString(): string + { + $compiled = ''; + foreach ($this->collection as $c) { + $compiled .= strval($c); + } + return $compiled; + } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Rss/Category.php b/src/Rss/Category.php index a0cb450..ae73678 100644 --- a/src/Rss/Category.php +++ b/src/Rss/Category.php @@ -5,11 +5,9 @@ use Stringable; -use Eightfold\XMLBuilder\Contracts\Buildable; - use Eightfold\XMLBuilder\Element; -class Category implements Buildable +class Category implements Stringable { public static function create(string $category, string $domain = ''): self { @@ -22,11 +20,6 @@ final private function __construct( ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { if (strlen($this->domain) > 0) { diff --git a/src/Rss/Cloud.php b/src/Rss/Cloud.php index 8257c5a..ca318bb 100644 --- a/src/Rss/Cloud.php +++ b/src/Rss/Cloud.php @@ -5,14 +5,16 @@ use Stringable; -use Eightfold\XMLBuilder\Contracts\Buildable; - use Eightfold\XMLBuilder\Element; -use Eightfold\Syndication\Rss\Enums\CloudProtocol; - -class Cloud implements Buildable +class Cloud implements Stringable { + const XMLRPC = 'xml-rpc'; + + const SOAP = 'soap'; + + const HTTPPOST = 'http-post'; + /** * @param string $domain The domain name or IP address of the cloud. * @param string $port The TCP port that the cloud is running on. @@ -29,7 +31,7 @@ public static function create( string $port, string $path, string $registerProcedure, - CloudProtocol $protocol + string $protocol ): self { return new self($domain, $port, $path, $registerProcedure, $protocol); } @@ -39,15 +41,10 @@ final private function __construct( readonly private string $port, readonly private string $path, readonly private string $registerProcedure, - readonly private CloudProtocol $protocol + readonly private string $protocol ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { return (string) Element::cloud()->omitEndTag()->props( @@ -55,7 +52,7 @@ public function __toString(): string 'port ' . $this->port, 'path ' . $this->path, 'registerProcedure ' . $this->registerProcedure, - 'protocol ' . $this->protocol->value + 'protocol ' . $this->protocol ); } } diff --git a/src/DocumentRss.php b/src/Rss/Document.php similarity index 84% rename from src/DocumentRss.php rename to src/Rss/Document.php index 44ed058..51cb991 100644 --- a/src/DocumentRss.php +++ b/src/Rss/Document.php @@ -1,20 +1,15 @@ xmlVersion = strval($version); + $this->xmlEncoding = $encoding; + $this->xmlStandalone = $standalone; + return $this; + } + public function withLanguage(string $language): self { $this->language = $language; @@ -234,21 +244,21 @@ public function __toString(): string } $pubDate = ''; - if ($this->pubDate !== null) { + if (isset($this->pubDate)) { $pubDate = Element::pubDate( $this->pubDate->format(DateTime::RSS) ); } $lastBuildDate = ''; - if ($this->lastBuildDate !== null) { + if (isset($this->lastBuildDate)) { $lastBuildDate = Element::lastBuildDate( $this->lastBuildDate->format(DateTime::RSS) ); } $categories = ''; - if ($this->categories !== null) { + if (isset($this->categories)) { $categories = $this->categories; } @@ -263,7 +273,7 @@ public function __toString(): string } $cloud = ''; - if ($this->cloud !== null) { + if (isset($this->cloud)) { $cloud = $this->cloud; } @@ -273,7 +283,7 @@ public function __toString(): string } $image = ''; - if ($this->image !== null) { + if (isset($this->image)) { $image = $this->image; } @@ -283,17 +293,17 @@ public function __toString(): string } $textInput = ''; - if ($this->textInput !== null) { + if (isset($this->textInput)) { $textInput = $this->textInput; } $skipHours = ''; - if ($this->skipHours !== null) { + if (isset($this->skipHours)) { $skipHours = $this->skipHours; } $skipDays = ''; - if ($this->skipDays !== null) { + if (isset($this->skipDays)) { $skipDays = $this->skipDays; } @@ -321,10 +331,10 @@ public function __toString(): string ) )->props('version ' . self::VERSION); - $doc = $doc->setVersion($this->xmlVersion); + $doc = $doc->withVersion($this->xmlVersion); if (strlen($this->xmlEncoding) > 0) { - $doc = $doc->setEncoding($this->xmlEncoding); + $doc = $doc->withEncoding($this->xmlEncoding); } else { $doc = $doc->removeEncoding(); @@ -332,7 +342,7 @@ public function __toString(): string } if (is_bool($this->xmlStandalone)) { - $doc = $doc->setStandalone($this->xmlStandalone); + $doc = $doc->withStandalone($this->xmlStandalone); } else { $doc = $doc->removeStandalone(); diff --git a/src/Rss/Enclosure.php b/src/Rss/Enclosure.php index 46e3435..a2a66ac 100644 --- a/src/Rss/Enclosure.php +++ b/src/Rss/Enclosure.php @@ -5,11 +5,9 @@ use Stringable; -use Eightfold\XMLBuilder\Contracts\Buildable; - use Eightfold\XMLBuilder\Element; -class Enclosure implements Buildable +class Enclosure implements Stringable { public static function create( string $url, @@ -26,11 +24,6 @@ final private function __construct( ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { return (string) Element::enclosure()->props( diff --git a/src/Rss/Enums/CloudProtocol.php b/src/Rss/Enums/CloudProtocol.php deleted file mode 100644 index c3da33a..0000000 --- a/src/Rss/Enums/CloudProtocol.php +++ /dev/null @@ -1,11 +0,0 @@ -isPermaLink) { diff --git a/src/Rss/Image.php b/src/Rss/Image.php index 8d423a2..404d18f 100644 --- a/src/Rss/Image.php +++ b/src/Rss/Image.php @@ -5,11 +5,9 @@ use Stringable; -use Eightfold\XMLBuilder\Contracts\Buildable; - use Eightfold\XMLBuilder\Element; -class Image implements Buildable +class Image implements Stringable { public static function create( string $url, diff --git a/src/Rss/Item.php b/src/Rss/Item.php index 0918e05..bd91404 100644 --- a/src/Rss/Item.php +++ b/src/Rss/Item.php @@ -12,35 +12,33 @@ namespace Eightfold\Syndication\Rss; use Stringable; -use DateTime; -use Eightfold\XMLBuilder\Contracts\Buildable; +use DateTime; use Eightfold\XMLBuilder\Element; use Eightfold\Syndication\Rss\Enclosure; - use Eightfold\Syndication\Rss\Guid; use Eightfold\Syndication\Rss\Source; use Eightfold\Syndication\Rss\Categories; -class Item implements Buildable +class Item implements Stringable { private string $link = ''; - private ?Guid $guid = null; + private Guid $guid; - private ?DateTime $pubDate = null; + private DateTime $pubDate; private string $author = ''; - private ?Categories $categories = null; + private Categories $categories; private string $comments = ''; - private ?Enclosure $enclosure = null; + private Enclosure $enclosure; - private ?Source $source = null; + private Source $source; public static function create( string $title = '', @@ -142,26 +140,26 @@ public function __toString(): string ? '' : Element::author($this->author); - $categories = ($this->categories === null) ? '' : $this->categories; + $categories = (isset($this->categories)) ? $this->categories : ''; $comments = (strlen($this->comments) === 0) ? '' : Element::comments($this->comments); - $enclosure = ($this->enclosure === null) - ? '' - : $this->enclosure; + $enclosure = (isset($this->enclosure)) + ? $this->enclosure + : ''; - $guid = ($this->guid === null) ? '' : $this->guid; + $guid = (isset($this->guid)) ? $this->guid : ''; $pubDate = ''; - if ($this->pubDate !== null) { + if (isset($this->pubDate)) { $pubDate = Element::pubDate( $this->pubDate->format(DateTime::RSS) ); } - $source = ($this->source === null) ? '' : $this->source; + $source = (isset($this->source)) ? $this->source : ''; return (string) Element::item( $title, diff --git a/src/Rss/Items.php b/src/Rss/Items.php index 2d7fba0..82c60e1 100644 --- a/src/Rss/Items.php +++ b/src/Rss/Items.php @@ -6,17 +6,12 @@ use Traversable; use Iterator; use Countable; - -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; use Eightfold\Syndication\Rss\Item; -use Eightfold\Syndication\Implementations\CollectionStringableImp; - -class Items implements Traversable, Iterator, Countable, Buildable +class Items implements Traversable, Iterator, Countable, Stringable { - use CollectionStringableImp; - public static function create(Item ...$items): self { return new self(...$items); @@ -26,4 +21,52 @@ final private function __construct(Item ...$items) { $this->collection = $items; } + + /** Stringable **/ + public function __toString(): string + { + $compiled = ''; + foreach ($this->collection as $c) { + $compiled .= strval($c); + } + return $compiled; + } + + /** JsonSerializable **/ + public function jsonSerialize(): array + { + return $this->collection; + } + + /** Countable **/ + public function count(): int + { + return count($this->collection); + } + + /** Iterator **/ + public function current(): object + { + return $this->collection[$this->position]; + } + + public function rewind(): void + { + $this->position = 0; + } + + public function key(): int|string + { + return $this->position; + } + + public function next(): void + { + ++$this->position; + } + + public function valid(): bool + { + return isset($this->collection[$this->position]); + } } diff --git a/src/Rss/SkipDays.php b/src/Rss/SkipDays.php index 3e4bdb9..0b659cc 100644 --- a/src/Rss/SkipDays.php +++ b/src/Rss/SkipDays.php @@ -5,29 +5,35 @@ use Stringable; -use Eightfold\XMLBuilder\Contracts\Buildable; - use Eightfold\XMLBuilder\Element; use Eightfold\Syndication\Rss\Enums\SkipDaysDay; -class SkipDays implements Buildable +class SkipDays implements Stringable { + const MONDAY = 'Monday'; + const TUESDAY = 'Tuesday'; + const WEDNESDAY = 'Wednesday'; + const THURSDAY = 'Thursday'; + const FRIDAY = 'Friday'; + const SATURDAY = 'Saturday'; + const SUNDAY = 'Sunday'; + /** * @var string[] */ private array $days = []; - public static function create(SkipDaysDay ...$days): self + public static function create(string ...$days): self { return new self(...$days); } - final private function __construct(SkipDaysDay ...$days) + final private function __construct(string ...$days) { foreach ($days as $day) { - if (in_array($day->value, $this->days) === false) { - $this->days[] = $day->value; + if (in_array($day, $this->days) === false) { + $this->days[] = $day; } } } diff --git a/src/Rss/SkipHours.php b/src/Rss/SkipHours.php index 23cbbb4..765c87f 100644 --- a/src/Rss/SkipHours.php +++ b/src/Rss/SkipHours.php @@ -5,11 +5,9 @@ use Stringable; -use Eightfold\XMLBuilder\Contracts\Buildable; - use Eightfold\XMLBuilder\Element; -class SkipHours implements Buildable +class SkipHours implements Stringable { /** * @var int[] @@ -26,11 +24,6 @@ final private function __construct(int ...$hours) $this->hours = array_unique($hours); } - public function build(): string - { - return strval($this); - } - private function valid(): bool { return count($this->hours) > 0; @@ -53,6 +46,7 @@ public function __toString(): string $h[] = Element::hour( strval($hour) ); + } if (count($h) === 24) { diff --git a/src/Rss/Source.php b/src/Rss/Source.php index 085ee70..f67b8ac 100644 --- a/src/Rss/Source.php +++ b/src/Rss/Source.php @@ -5,11 +5,9 @@ use Stringable; -use Eightfold\XMLBuilder\Contracts\Buildable; - use Eightfold\XMLBuilder\Element; -class Source implements Buildable +class Source implements Stringable { public static function create( string $title, @@ -24,11 +22,6 @@ final private function __construct( ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { return (string) Element::source($this->title)->props( diff --git a/src/Rss/TextInput.php b/src/Rss/TextInput.php index da2c6a7..260f268 100644 --- a/src/Rss/TextInput.php +++ b/src/Rss/TextInput.php @@ -5,11 +5,9 @@ use Stringable; -use Eightfold\XMLBuilder\Contracts\Buildable; - use Eightfold\XMLBuilder\Element; -class TextInput implements Buildable +class TextInput implements Stringable { public static function create( string $title, @@ -28,11 +26,6 @@ final private function __construct( ) { } - public function build(): string - { - return strval($this); - } - public function __toString(): string { return (string) Element::textInput( diff --git a/tests/Atom/AtomTest.php b/tests/Atom/AtomTest.php index 9c3c577..f982ac4 100644 --- a/tests/Atom/AtomTest.php +++ b/tests/Atom/AtomTest.php @@ -5,7 +5,7 @@ use PHPUnit\Framework\TestCase; -use Eightfold\Syndication\DocumentAtom; +use Eightfold\Syndication\Atom\Document; use Eightfold\Syndication\Atom\Title; use Eightfold\Syndication\Atom\Content; @@ -17,8 +17,6 @@ use Eightfold\Syndication\Atom\Links; use Eightfold\Syndication\Atom\Link; -use Eightfold\Syndication\Atom\Enums\LinkRel; - use Eightfold\Syndication\Atom\Entries; use Eightfold\Syndication\Atom\Entry; @@ -31,11 +29,11 @@ class AtomTest extends TestCase */ public function can_output_sample_01(): void { - $file = __DIR__ . '/sample-01.xml'; + $file = __DIR__ . '/samples/01.xml'; $expected = file_get_contents($file); - $result = (string) DocumentAtom::create( + $result = (string) Document::create( id: 'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6', title: Title::create('Example Feed'), updated: DateTime::createFromFormat( @@ -64,7 +62,7 @@ public function can_output_sample_01(): void ) ) ) - )->xmlDeclaration(); + )->withXmlDeclaration(); $this->assertSame( $expected, @@ -79,7 +77,7 @@ public function must_not_have_more_than_one_alternate_link(): void { $expected = ''; - $result = (string) DocumentAtom::create( + $result = (string) Document::create( title: Title::create('Scripting News'), updated: DateTime::createFromFormat( DateTime::ATOM, @@ -92,7 +90,7 @@ public function must_not_have_more_than_one_alternate_link(): void ), Link::create( href: '/feed', - rel: LinkRel::ALTERNATE + rel: Link::ALTERNATE ) ), entries: Entries::create( @@ -117,7 +115,7 @@ public function must_not_have_more_than_one_alternate_link(): void some_unique_stringScripting News2003-12-13T18:30:02+00:00Titlesome_unique_string2003-12-13T18:30:02ZJohn Doe/feed xml; - $result = (string) DocumentAtom::create( + $result = (string) Document::create( title: Title::create('Scripting News'), updated: DateTime::createFromFormat( DateTime::ATOM, @@ -130,7 +128,7 @@ public function must_not_have_more_than_one_alternate_link(): void ), Link::create( href: '/feed', - rel: LinkRel::SELF + rel: Link::SELF ) ), entries: Entries::create( @@ -162,7 +160,7 @@ public function must_have_at_least_one_author(): void { $expected = ''; - $result = (string) DocumentAtom::create( + $result = (string) Document::create( title: Title::create('Scripting News'), updated: DateTime::createFromFormat( DateTime::ATOM, @@ -191,7 +189,7 @@ public function must_have_at_least_one_author(): void some_unique_stringScripting News2003-12-13T18:30:02+00:00John DoeJane DoeTitlesome_unique_string2003-12-13T18:30:02ZHello, World! xml; - $result = (string) DocumentAtom::create( + $result = (string) Document::create( title: Title::create('Scripting News'), updated: DateTime::createFromFormat( DateTime::ATOM, @@ -225,7 +223,7 @@ public function must_have_at_least_one_author(): void some_unique_stringScripting News2003-12-13T18:30:02+00:00Titlesome_unique_string2003-12-13T18:30:02ZJohn DoeHello, World!Titlesome_unique_string2003-12-13T18:30:02ZJane DoeHello, World! xml; - $result = (string) DocumentAtom::create( + $result = (string) Document::create( id: 'some_unique_string', title: Title::create('Scripting News'), updated: DateTime::createFromFormat( diff --git a/tests/Atom/sample-01.xml b/tests/Atom/samples/01.xml similarity index 100% rename from tests/Atom/sample-01.xml rename to tests/Atom/samples/01.xml diff --git a/tests/Json/JsonFeedTest.php b/tests/Json/JsonFeedTest.php deleted file mode 100644 index db8cbfe..0000000 --- a/tests/Json/JsonFeedTest.php +++ /dev/null @@ -1,114 +0,0 @@ -withUrl( - 'https://example.org/second-item' - ), - Item::create( - id: '1', - content: ContentHtml::create('

Hello, world!

') - )->withUrl( - 'https://example.org/initial-post' - ) - ) - ); - - $result = json_encode( - $doc, - JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT - ); - - $this->assertSame( - $expected, - $result . "\n" - ); - } - - /** - * @test - */ - public function can_output_sample_03(): void - { - $file = __DIR__ . '/sample-03.json'; - - $expected = file_get_contents($file); - - $doc = DocumentJson::create( - title: 'Brent Simmons’s Microblog', - homePageUrl: 'https://example.org/', - feedUrl: 'https://example.org/feed.json', - items: Items::create( - Item::create( - id: '2347259', - // note: Using double prime because new line \n - content: "Cats are neat. \n\nhttps://example.org/cats" - )->withUrl( - 'https://example.org/2347259' - )->withDatePublished( - DateTime::createFromFormat( - DateTime::ATOM, - '2016-02-09T14:22:00-07:00' - ) - ) - ) - )->withAuthors( - Authors::create( - Author::create( - 'Brent Simmons', - 'http://example.org/', - 'https://example.org/avatar.png' - ) - ) - )->withUserComment( - 'This is a microblog feed. You can add this to your feed reader using the following URL: https://example.org/feed.json' - ); - - $result = json_encode( - $doc, - JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE - ); - - $this->assertSame( - $expected, - $result . "\n" - ); - } -} diff --git a/tests/Json/MainTest.php b/tests/Json/MainTest.php new file mode 100644 index 0000000..dba3f7c --- /dev/null +++ b/tests/Json/MainTest.php @@ -0,0 +1,221 @@ +withUrl( + 'https://example.org/second-item' + ), + Item::create( + id: '1', + content: ContentHtml::create('

Hello, world!

') + )->withUrl( + 'https://example.org/initial-post' + ) + ) + ); + + $result = json_encode( + $doc, + JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT + ); + + $this->assertSame( + $expected, + $result . "\n" + ); + } + + /** + * @test + */ + public function can_output_sample_02(): void + { + $file = __DIR__ . '/samples/02.json'; + + $expected = file_get_contents($file); + + $doc = Document::create( + title: 'The Record', + homePageUrl: 'http://therecord.co/', + feedUrl: 'http://therecord.co/feed.json', + items: Items::create( + Item::create( + id: 'http://therecord.co/chris-parrish', + content: 'Chris has worked at Adobe and as a founder of Rogue Sheep, which won an Apple Design Award for Postage. Chris’s new company is Aged & Distilled with Guy English — which shipped Napkin, a Mac app for visual collaboration. Chris is also the co-host of The Record. He lives on Bainbridge Island, a quick ferry ride from Seattle.' + )->withExtraContent( + ContentHtml::create( + 'Chris has worked at Adobe and as a founder of Rogue Sheep, which won an Apple Design Award for Postage. Chris’s new company is Aged & Distilled with Guy English — which shipped Napkin, a Mac app for visual collaboration. Chris is also the co-host of The Record. He lives on Bainbridge Island, a quick ferry ride from Seattle.' + ) + )->withUrl( + 'http://therecord.co/chris-parrish' + )->withTitle( + 'Special #1 - Chris Parrish' + )->withSummary( + 'Brent interviews Chris Parrish, co-host of The Record and one-half of Aged & Distilled.' + )->withDatePublished( + DateTime::createFromFormat( + DateTime::ATOM, + '2014-05-09T14:04:00-07:00' + ) + )->withAttachments( + Attachments::create( + Attachment::create( + url: 'http://therecord.co/downloads/The-Record-sp1e1-ChrisParrish.m4a', + mimeType: 'audio/x-m4a', + size: 89970236, + duration: 6629 + ) + ) + ) + ) + )->withUserComment( + 'This is a podcast feed. You can add this feed to your podcast client using the following URL: http://therecord.co/feed.json' + ); + + $result = json_encode( + $doc, + JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE + ); + + $this->assertSame( + $expected, + $result . "\n" + ); + } + + /** + * @test + */ + public function can_output_sample_03(): void + { + $file = __DIR__ . '/samples/03.json'; + + $expected = file_get_contents($file); + + $doc = Document::create( + title: 'Brent Simmons’s Microblog', + homePageUrl: 'https://example.org/', + feedUrl: 'https://example.org/feed.json', + items: Items::create( + Item::create( + id: '2347259', + // note: Using double prime because new line \n + content: "Cats are neat. \n\nhttps://example.org/cats" + )->withUrl( + 'https://example.org/2347259' + )->withDatePublished( + DateTime::createFromFormat( + DateTime::ATOM, + '2016-02-09T14:22:00-07:00' + ) + ) + ) + )->withAuthors( + Authors::create( + Author::create( + 'Brent Simmons', + 'http://example.org/', + 'https://example.org/avatar.png' + ) + ) + )->withUserComment( + 'This is a microblog feed. You can add this to your feed reader using the following URL: https://example.org/feed.json' + ); + + $result = json_encode( + $doc, + JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE + ); + + $this->assertSame( + $expected, + $result . "\n" + ); + } + + /** + * @test + */ + public function can_handle_extensions(): void + { + $file = __DIR__ . '/samples/extended.json'; + + $expected = file_get_contents($file); + + $customObject = new StdClass(); + $customObject->about = 'https://blueshed-podcasts.com/json-feed-extension-docs'; + $customObject->explicit = false; + $customObject->copyright = '1948 by George Orwell'; + $customObject->owner = 'Big Brother and the Holding Company'; + $customObject->subtitle = 'All shouting, all the time. Double. Plus. Good.'; + + $doc = Document::create( + title: 'My Example Feed', + items: Items::create( + Item::create( + id: '2', + content: 'This is a second item.' + )->withExtensions( + CustomObjects::create( + CustomObject::create('_blue_shed', $customObject) + ) + ) + ) + )->withExtensions( + CustomObjects::create( + CustomObject::create('_blue_shed', $customObject) + ) + ); + + $result = json_encode( + $doc, + JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE + ); + + $this->assertSame( + $expected, + $result . "\n" + ); + } +} diff --git a/tests/Json/sample-01.json b/tests/Json/samples/01.json similarity index 100% rename from tests/Json/sample-01.json rename to tests/Json/samples/01.json diff --git a/tests/Json/sample-02.json b/tests/Json/samples/02.json similarity index 100% rename from tests/Json/sample-02.json rename to tests/Json/samples/02.json diff --git a/tests/Json/sample-03.json b/tests/Json/samples/03.json similarity index 100% rename from tests/Json/sample-03.json rename to tests/Json/samples/03.json diff --git a/tests/Json/samples/extended.json b/tests/Json/samples/extended.json new file mode 100644 index 0000000..bf1751c --- /dev/null +++ b/tests/Json/samples/extended.json @@ -0,0 +1,24 @@ +{ + "version": "https://jsonfeed.org/version/1.1", + "title": "My Example Feed", + "items": [ + { + "id": "2", + "content_text": "This is a second item.", + "_blue_shed": { + "about": "https://blueshed-podcasts.com/json-feed-extension-docs", + "explicit": false, + "copyright": "1948 by George Orwell", + "owner": "Big Brother and the Holding Company", + "subtitle": "All shouting, all the time. Double. Plus. Good." + } + } + ], + "_blue_shed": { + "about": "https://blueshed-podcasts.com/json-feed-extension-docs", + "explicit": false, + "copyright": "1948 by George Orwell", + "owner": "Big Brother and the Holding Company", + "subtitle": "All shouting, all the time. Double. Plus. Good." + } +} diff --git a/tests/Rss/CloudTest.php b/tests/Rss/CloudTest.php index 6ee89e9..c644601 100644 --- a/tests/Rss/CloudTest.php +++ b/tests/Rss/CloudTest.php @@ -7,8 +7,6 @@ use Eightfold\Syndication\Rss\Cloud; -use Eightfold\Syndication\Rss\Enums\CloudProtocol; - class CloudTest extends TestCase { /** @@ -23,7 +21,7 @@ public function compound(): void '80', '/RPC2', 'xmlStorageSystem.rssPleaseNotify', - CloudProtocol::XMLRPC + Cloud::XMLRPC ); $this->assertSame( diff --git a/tests/Rss/RssTest.php b/tests/Rss/RssTest.php index 9790683..99e1d6c 100644 --- a/tests/Rss/RssTest.php +++ b/tests/Rss/RssTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; -use Eightfold\Syndication\DocumentRss; +use Eightfold\Syndication\Rss\Document; use Eightfold\Syndication\Rss\Items; use Eightfold\Syndication\Rss\Item; @@ -23,7 +23,7 @@ public function required_fields_are_required_by_initializer(): void { $expected = ''; - $result = (string) DocumentRss::create( + $result = (string) Document::create( title: 'title', link: '/feed', description: 'description', @@ -35,11 +35,11 @@ public function required_fields_are_required_by_initializer(): void $result ); - $file = __DIR__ . '/required-01.xml'; + $file = __DIR__ . '/samples/required-01.xml'; $expected = file_get_contents($file); - $result = (string) DocumentRss::create( + $result = (string) Document::create( title: 'title', link: '/feed', description: 'description', @@ -55,11 +55,11 @@ public function required_fields_are_required_by_initializer(): void $result . "\n" ); - $file = __DIR__ . '/required-02.xml'; + $file = __DIR__ . '/samples/required-02.xml'; $expected = file_get_contents($file); - $result = (string) DocumentRss::create( + $result = (string) Document::create( title: 'title', link: '/feed', description: 'description', @@ -81,11 +81,11 @@ public function required_fields_are_required_by_initializer(): void */ public function can_output_sample_01(): void { - $path = __DIR__ . '/sample-01.xml'; + $path = __DIR__ . '/samples/01.xml'; $expected = htmlspecialchars_decode(file_get_contents($path)); - $result = (string) DocumentRss::create( + $result = (string) Document::create( title: 'Liftoff News', link: 'http://liftoff.msfc.nasa.gov/', description: 'Liftoff to Space Exploration.', @@ -158,9 +158,13 @@ public function can_output_sample_01(): void DateTime::RSS, 'Tue, 10 Jun 2003 09:41:01 +0000' ) - )->withDocs('https://cyber.harvard.edu/rss/rss.html')->withGenerator( + )->withDocs( + 'https://cyber.harvard.edu/rss/rss.html' + )->withGenerator( 'Weblog Editor 2.0' - )->withManagingEditor('editor@example.com')->withWebMaster( + )->withManagingEditor( + 'editor@example.com' + )->withWebMaster( 'webmaster@example.com' ); diff --git a/tests/Rss/SkipDaysTest.php b/tests/Rss/SkipDaysTest.php index 0488570..3ac7e1e 100644 --- a/tests/Rss/SkipDaysTest.php +++ b/tests/Rss/SkipDaysTest.php @@ -6,7 +6,6 @@ use PHPUnit\Framework\TestCase; use Eightfold\Syndication\Rss\SkipDays; -use Eightfold\Syndication\Rss\Enums\SkipDaysDay; class SkipDaysTest extends TestCase { @@ -27,7 +26,7 @@ public function has_days(): void $expected = 'Monday'; $result = (string) SkipDays::create( - SkipDaysDay::MONDAY + SkipDays::MONDAY ); $this->assertSame( @@ -44,13 +43,13 @@ public function no_duplicate_days(): void $expected = 'MondayTuesday'; $result = (string) SkipDays::create( - SkipDaysDay::MONDAY, - SkipDaysDay::MONDAY, - SkipDaysDay::MONDAY, - SkipDaysDay::TUESDAY, - SkipDaysDay::TUESDAY, - SkipDaysDay::MONDAY, - SkipDaysDay::MONDAY, + SkipDays::MONDAY, + SkipDays::MONDAY, + SkipDays::MONDAY, + SkipDays::TUESDAY, + SkipDays::TUESDAY, + SkipDays::MONDAY, + SkipDays::MONDAY, ); $this->assertSame( diff --git a/tests/Rss/sample-01.xml b/tests/Rss/samples/01.xml similarity index 100% rename from tests/Rss/sample-01.xml rename to tests/Rss/samples/01.xml diff --git a/tests/Rss/required-01.xml b/tests/Rss/samples/required-01.xml similarity index 100% rename from tests/Rss/required-01.xml rename to tests/Rss/samples/required-01.xml diff --git a/tests/Rss/required-02.xml b/tests/Rss/samples/required-02.xml similarity index 100% rename from tests/Rss/required-02.xml rename to tests/Rss/samples/required-02.xml From 91326d6c78d4c90cae7c15c9415e497bd55ae6b9 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 25 Dec 2023 12:34:24 -0500 Subject: [PATCH 04/14] update: Dependencies --- composer.lock | 250 ++++++++++++++++++++++++++++---------------------- phpunit.xml | 27 ++---- 2 files changed, 151 insertions(+), 126 deletions(-) diff --git a/composer.lock b/composer.lock index fe69676..3e5865e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "aa852b08d41a4471d21e9aeafb488a90", + "content-hash": "90647e95d3d62cad945ba92fcd5371c5", "packages": [ { "name": "8fold/php-xml-builder", @@ -124,16 +124,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.18.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", "shasum": "" }, "require": { @@ -174,9 +174,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2023-12-10T21:03:43+00:00" }, { "name": "phar-io/manifest", @@ -291,16 +291,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.8", + "version": "1.10.50", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0166aef76e066f0dd2adc2799bdadfa1635711e9" + "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0166aef76e066f0dd2adc2799bdadfa1635711e9", - "reference": "0166aef76e066f0dd2adc2799bdadfa1635711e9", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/06a98513ac72c03e8366b5a0cb00750b487032e4", + "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4", "shasum": "" }, "require": { @@ -349,27 +349,27 @@ "type": "tidelift" } ], - "time": "2023-03-24T10:28:16+00:00" + "time": "2023-12-13T10:59:42+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.0.2", + "version": "10.1.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4" + "reference": "78c3b7625965c2513ee96569a4dbb62601784145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/20800e84296ea4732f9a125e08ce86b4004ae3e4", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1", "phpunit/php-file-iterator": "^4.0", "phpunit/php-text-template": "^3.0", @@ -381,7 +381,7 @@ "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -390,7 +390,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -418,7 +418,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.2" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" }, "funding": [ { @@ -426,20 +427,20 @@ "type": "github" } ], - "time": "2023-03-06T13:00:19+00:00" + "time": "2023-12-21T15:38:30+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "4.0.1", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { @@ -478,7 +479,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -486,7 +488,7 @@ "type": "github" } ], - "time": "2023-02-10T16:53:14+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", @@ -553,16 +555,16 @@ }, { "name": "phpunit/php-text-template", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { @@ -600,7 +602,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -608,7 +611,7 @@ "type": "github" } ], - "time": "2023-02-03T06:56:46+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", @@ -671,16 +674,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.0.18", + "version": "10.5.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "582563ed2edc62d1455cdbe00ea49fe09428eef3" + "reference": "6fce887c71076a73f32fd3e0774a6833fc5c7f19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/582563ed2edc62d1455cdbe00ea49fe09428eef3", - "reference": "582563ed2edc62d1455cdbe00ea49fe09428eef3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6fce887c71076a73f32fd3e0774a6833fc5c7f19", + "reference": "6fce887c71076a73f32fd3e0774a6833fc5c7f19", "shasum": "" }, "require": { @@ -694,7 +697,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=8.1", - "phpunit/php-code-coverage": "^10.0", + "phpunit/php-code-coverage": "^10.1.5", "phpunit/php-file-iterator": "^4.0", "phpunit/php-invoker": "^4.0", "phpunit/php-text-template": "^3.0", @@ -704,8 +707,8 @@ "sebastian/comparator": "^5.0", "sebastian/diff": "^5.0", "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.0", - "sebastian/global-state": "^6.0", + "sebastian/exporter": "^5.1", + "sebastian/global-state": "^6.0.1", "sebastian/object-enumerator": "^5.0", "sebastian/recursion-context": "^5.0", "sebastian/type": "^4.0", @@ -720,7 +723,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -752,7 +755,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.18" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.3" }, "funding": [ { @@ -768,7 +771,7 @@ "type": "tidelift" } ], - "time": "2023-03-22T06:15:31+00:00" + "time": "2023-12-13T07:25:23+00:00" }, { "name": "sebastian/cli-parser", @@ -939,16 +942,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { @@ -959,7 +962,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { @@ -1003,7 +1006,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -1011,24 +1015,24 @@ "type": "github" } ], - "time": "2023-02-03T07:07:16+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -1037,7 +1041,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -1060,7 +1064,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -1068,20 +1073,20 @@ "type": "github" } ], - "time": "2023-02-03T06:59:47+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "5.0.1", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", - "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", "shasum": "" }, "require": { @@ -1094,7 +1099,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -1127,7 +1132,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" }, "funding": [ { @@ -1135,20 +1140,20 @@ "type": "github" } ], - "time": "2023-03-23T05:12:41+00:00" + "time": "2023-12-22T10:55:06+00:00" }, { "name": "sebastian/environment", - "version": "6.0.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc" + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", "shasum": "" }, "require": { @@ -1190,7 +1195,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" }, "funding": [ { @@ -1198,20 +1204,20 @@ "type": "github" } ], - "time": "2023-02-03T07:03:04+00:00" + "time": "2023-04-11T05:39:26+00:00" }, { "name": "sebastian/exporter", - "version": "5.0.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", "shasum": "" }, "require": { @@ -1225,7 +1231,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -1267,7 +1273,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" }, "funding": [ { @@ -1275,20 +1282,20 @@ "type": "github" } ], - "time": "2023-02-03T07:06:49+00:00" + "time": "2023-09-24T13:22:09+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "aab257c712de87b90194febd52e4d184551c2d44" + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", - "reference": "aab257c712de87b90194febd52e4d184551c2d44", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", "shasum": "" }, "require": { @@ -1328,7 +1335,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" }, "funding": [ { @@ -1336,24 +1344,24 @@ "type": "github" } ], - "time": "2023-02-03T07:07:38+00:00" + "time": "2023-07-19T07:19:23+00:00" }, { "name": "sebastian/lines-of-code", - "version": "2.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -1385,7 +1393,8 @@ "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/2.0.0" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -1393,7 +1402,7 @@ "type": "github" } ], - "time": "2023-02-03T07:08:02+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", @@ -1681,16 +1690,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.8.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", "shasum": "" }, "require": { @@ -1700,7 +1709,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/phpcs", @@ -1719,35 +1728,58 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2023-02-22T23:07:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T12:32:31+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", "shasum": "" }, "require": { @@ -1776,7 +1808,7 @@ "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" + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" }, "funding": [ { @@ -1784,7 +1816,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-11-20T00:12:19+00:00" } ], "aliases": [], diff --git a/phpunit.xml b/phpunit.xml index 2826b84..d71b510 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,21 +1,6 @@ - - - - ./src/ - - - vendor/ - - + + ./tests @@ -25,4 +10,12 @@ + + + ./src/ + + + vendor/ + + From 9f4629e8c32b0a8a6d58a69a9bb8554843d66d73 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 25 Dec 2023 12:34:38 -0500 Subject: [PATCH 05/14] add: Collection private array --- src/Rss/Items.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Rss/Items.php b/src/Rss/Items.php index 82c60e1..dfc46bd 100644 --- a/src/Rss/Items.php +++ b/src/Rss/Items.php @@ -12,6 +12,8 @@ class Items implements Traversable, Iterator, Countable, Stringable { + private array $collection = []; + public static function create(Item ...$items): self { return new self(...$items); From 2527b89bb82b4d89c3c30ad54f37cc7aad6042aa Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 25 Dec 2023 12:51:22 -0500 Subject: [PATCH 06/14] fix: Visibility of Class const --- src/Atom/Link.php | 10 +++++----- src/Atom/TextTypes.php | 6 +++--- src/Rss/Cloud.php | 8 +++----- src/Rss/SkipDays.php | 14 +++++++------- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/Atom/Link.php b/src/Atom/Link.php index d605a27..3af3baf 100644 --- a/src/Atom/Link.php +++ b/src/Atom/Link.php @@ -9,11 +9,11 @@ class Link implements Stringable { - const ALTERNATE = 'alternate'; - const ENCLOSURE = 'enclosure'; - const RELATED = 'related'; - const SELF = 'self'; - const VIA = 'via'; + public const ALTERNATE = 'alternate'; + public const ENCLOSURE = 'enclosure'; + public const RELATED = 'related'; + public const SELF = 'self'; + public const VIA = 'via'; public static function create( string $href, diff --git a/src/Atom/TextTypes.php b/src/Atom/TextTypes.php index ef2bce7..c56ea77 100644 --- a/src/Atom/TextTypes.php +++ b/src/Atom/TextTypes.php @@ -5,7 +5,7 @@ class TextTypes { - const TEXT = 'text'; - const HTML = 'html'; - const XHTML = 'xhtml'; + public const TEXT = 'text'; + public const HTML = 'html'; + public const XHTML = 'xhtml'; } diff --git a/src/Rss/Cloud.php b/src/Rss/Cloud.php index ca318bb..bf38f0f 100644 --- a/src/Rss/Cloud.php +++ b/src/Rss/Cloud.php @@ -9,11 +9,9 @@ class Cloud implements Stringable { - const XMLRPC = 'xml-rpc'; - - const SOAP = 'soap'; - - const HTTPPOST = 'http-post'; + public const XMLRPC = 'xml-rpc'; + public const SOAP = 'soap'; + public const HTTPPOST = 'http-post'; /** * @param string $domain The domain name or IP address of the cloud. diff --git a/src/Rss/SkipDays.php b/src/Rss/SkipDays.php index 0b659cc..3cf360a 100644 --- a/src/Rss/SkipDays.php +++ b/src/Rss/SkipDays.php @@ -11,13 +11,13 @@ class SkipDays implements Stringable { - const MONDAY = 'Monday'; - const TUESDAY = 'Tuesday'; - const WEDNESDAY = 'Wednesday'; - const THURSDAY = 'Thursday'; - const FRIDAY = 'Friday'; - const SATURDAY = 'Saturday'; - const SUNDAY = 'Sunday'; + public const MONDAY = 'Monday'; + public const TUESDAY = 'Tuesday'; + public const WEDNESDAY = 'Wednesday'; + public const THURSDAY = 'Thursday'; + public const FRIDAY = 'Friday'; + public const SATURDAY = 'Saturday'; + public const SUNDAY = 'Sunday'; /** * @var string[] From 5e8607c601b908572bdc626f2d6677d7523b5bbd Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 25 Dec 2023 12:53:33 -0500 Subject: [PATCH 07/14] fix: RSS Items --- src/Rss/Items.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Rss/Items.php b/src/Rss/Items.php index dfc46bd..85537f1 100644 --- a/src/Rss/Items.php +++ b/src/Rss/Items.php @@ -14,6 +14,8 @@ class Items implements Traversable, Iterator, Countable, Stringable { private array $collection = []; + private int $position = 0; + public static function create(Item ...$items): self { return new self(...$items); @@ -34,7 +36,11 @@ public function __toString(): string return $compiled; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + */ public function jsonSerialize(): array { return $this->collection; From 827171e49af56e194d3ef22004ef83b4ab57463d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 25 Dec 2023 12:58:38 -0500 Subject: [PATCH 08/14] fix: Property type --- src/Rss/Cloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rss/Cloud.php b/src/Rss/Cloud.php index bf38f0f..af1bd55 100644 --- a/src/Rss/Cloud.php +++ b/src/Rss/Cloud.php @@ -19,7 +19,7 @@ class Cloud implements Stringable * @param string $path The location of its responder. * @param string $registerProcedure The name of the procedure to call to * request notification. - * @param CloudProtocol $protocol Is xml-rpc, soap, or + * @param string $protocol Is xml-rpc, soap, or * http-post (case-sensitive), indicating which protocol is to be used. * * @return self From 764943a2307f25e50e4292292954fc8db4d9bf77 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 25 Dec 2023 12:58:52 -0500 Subject: [PATCH 09/14] fix: JsonSerializable stan --- src/Atom/Authors.php | 6 +++++- src/Atom/Categories.php | 6 +++++- src/Atom/Contributors.php | 6 +++++- src/Atom/Entries.php | 6 +++++- src/Atom/Links.php | 6 +++++- src/Json/Attachments.php | 6 +++++- src/Json/Authors.php | 6 +++++- src/Json/CustomObjects.php | 6 +++++- src/Json/Hubs.php | 6 +++++- src/Json/Items.php | 6 +++++- src/Rss/Categories.php | 6 +++++- 11 files changed, 55 insertions(+), 11 deletions(-) diff --git a/src/Atom/Authors.php b/src/Atom/Authors.php index f7e2578..111ea9c 100644 --- a/src/Atom/Authors.php +++ b/src/Atom/Authors.php @@ -36,7 +36,11 @@ public function __toString(): string return $compiled; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Atom/Categories.php b/src/Atom/Categories.php index 87779af..752137b 100644 --- a/src/Atom/Categories.php +++ b/src/Atom/Categories.php @@ -36,7 +36,11 @@ public function __toString(): string return $compiled; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Atom/Contributors.php b/src/Atom/Contributors.php index 1d0de2d..dde8e35 100644 --- a/src/Atom/Contributors.php +++ b/src/Atom/Contributors.php @@ -36,7 +36,11 @@ public function __toString(): string return $compiled; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Atom/Entries.php b/src/Atom/Entries.php index efe1aac..193d4e8 100644 --- a/src/Atom/Entries.php +++ b/src/Atom/Entries.php @@ -50,7 +50,11 @@ public function __toString(): string return $compiled; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Atom/Links.php b/src/Atom/Links.php index ac75ecb..7b10b13 100644 --- a/src/Atom/Links.php +++ b/src/Atom/Links.php @@ -36,7 +36,11 @@ public function __toString(): string return $compiled; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Json/Attachments.php b/src/Json/Attachments.php index b60d088..1e4a370 100644 --- a/src/Json/Attachments.php +++ b/src/Json/Attachments.php @@ -26,7 +26,11 @@ final private function __construct(Attachment ...$attachments) $this->collection = $attachments; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Json/Authors.php b/src/Json/Authors.php index f444d15..797c516 100644 --- a/src/Json/Authors.php +++ b/src/Json/Authors.php @@ -26,7 +26,11 @@ final private function __construct(Author ...$authors) $this->collection = $authors; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Json/CustomObjects.php b/src/Json/CustomObjects.php index e1a4e1a..b140526 100644 --- a/src/Json/CustomObjects.php +++ b/src/Json/CustomObjects.php @@ -26,7 +26,11 @@ final private function __construct(CustomObject ...$objects) $this->collection = $objects; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Json/Hubs.php b/src/Json/Hubs.php index 989fd00..61f6378 100644 --- a/src/Json/Hubs.php +++ b/src/Json/Hubs.php @@ -26,7 +26,11 @@ final private function __construct(Hub ...$hubs) $this->collection = $hubs; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Json/Items.php b/src/Json/Items.php index c4b594b..fe27790 100644 --- a/src/Json/Items.php +++ b/src/Json/Items.php @@ -26,7 +26,11 @@ final private function __construct(Item ...$items) $this->collection = $items; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; diff --git a/src/Rss/Categories.php b/src/Rss/Categories.php index 989763c..f546481 100644 --- a/src/Rss/Categories.php +++ b/src/Rss/Categories.php @@ -36,7 +36,11 @@ public function __toString(): string return $compiled; } - /** JsonSerializable **/ + /** + * JsonSerializable + * + * @return array + **/ public function jsonSerialize(): array { return $this->collection; From 8cbc7aa5c37f60ac1551e1df216e3b4fa47cc229 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 25 Dec 2023 14:49:17 -0500 Subject: [PATCH 10/14] fix: Stringable stan --- src/Json/Attachment.php | 25 ++++++++-- src/Json/Author.php | 29 +++++++++--- src/Json/CustomObject.php | 9 ++-- src/Json/Document.php | 72 ++++++++++++++++++++++------- src/Json/Item.php | 97 ++++++++++++++++++++++++++++----------- 5 files changed, 174 insertions(+), 58 deletions(-) diff --git a/src/Json/Attachment.php b/src/Json/Attachment.php index 69fbd25..c8583ee 100644 --- a/src/Json/Attachment.php +++ b/src/Json/Attachment.php @@ -12,7 +12,7 @@ class Attachment implements JsonSerializable { - private CusstomObjects $customObjects; + private CustomObjects $customObjects; public static function create( string|Stringable $url, @@ -44,15 +44,30 @@ public function withExtensions(CustomObjects $customObjects): self return $this->withCustomObjects($customObjects); } + private function url(): string + { + return (string) $this->url; + } + + private function title(): string + { + return (string) $this->title; + } + + private function mimeType(): string + { + return (string) $this->mimeType; + } + /** JsonSerializable **/ public function jsonSerialize(): StdClass { $obj = new StdClass(); - $obj->url = $this->url; - $obj->mime_type = $this->mimeType; + $obj->url = $this->url(); + $obj->mime_type = $this->mimeType(); - if (strlen($this->title) > 0) { - $obj->title = $this->title; + if (strlen($this->title()) > 0) { + $obj->title = $this->title(); } if ($this->size > 0) { diff --git a/src/Json/Author.php b/src/Json/Author.php index 9ec0c58..00f85e3 100644 --- a/src/Json/Author.php +++ b/src/Json/Author.php @@ -12,7 +12,7 @@ class Author implements JsonSerializable { - private CusstomObjects $customObjects; + private CustomObjects $customObjects; public static function create( string|Stringable $name = '', @@ -40,21 +40,36 @@ public function withExtensions(CustomObjects $customObjects): self return $this->withCustomObjects($customObjects); } + private function name(): string + { + return (string) $this->name; + } + + private function url(): string + { + return (string) $this->url; + } + + private function avatar(): string + { + return (string) $this->avatar; + } + /** JsonSerializable **/ public function jsonSerialize(): StdClass { $obj = new StdClass(); - if (strlen($this->name) > 0) { - $obj->name = (string) $this->name; + if (strlen($this->name()) > 0) { + $obj->name = $this->name(); } - if (strlen($this->url) > 0) { - $obj->url = (string) $this->url; + if (strlen($this->url()) > 0) { + $obj->url = $this->url(); } - if (strlen($this->avatar) > 0) { - $obj->avatar = (string) $this->avatar; + if (strlen($this->avatar()) > 0) { + $obj->avatar = (string) $this->avatar(); } if (isset($this->customObjects)) { diff --git a/src/Json/CustomObject.php b/src/Json/CustomObject.php index f1ce2bb..2b8244b 100644 --- a/src/Json/CustomObject.php +++ b/src/Json/CustomObject.php @@ -24,14 +24,15 @@ final private function __construct( public function name(): string { - if (str_contains($this->name, '.')) { + $name = (string) $this->name; + if (str_contains($name, '.')) { return ''; } - if (str_starts_with($this->name, '_')) { - return $this->name; + if (str_starts_with($name, '_')) { + return $name; } - return '_' . $this->name; + return '_' . $name; } public function object(): StdClass diff --git a/src/Json/Document.php b/src/Json/Document.php index 2805dff..18d9997 100644 --- a/src/Json/Document.php +++ b/src/Json/Document.php @@ -125,6 +125,46 @@ public function withExtensions(CustomObjects $customObjects): self return $this->withCustomObjects($customObjects); } + private function homePageUrl(): string + { + return (string) $this->homePageUrl; + } + + private function feedUrl(): string + { + return (string) $this->feedUrl; + } + + private function description(): string + { + return (string) $this->description; + } + + private function userComment(): string + { + return (string) $this->userComment; + } + + private function nextUrl(): string + { + return (string) $this->nextUrl; + } + + private function icon(): string + { + return (string) $this->icon; + } + + private function favicon(): string + { + return (string) $this->favicon; + } + + private function language(): string + { + return (string) $this->language; + } + /** JsonSerializable **/ public function jsonSerialize(): mixed { @@ -132,40 +172,40 @@ public function jsonSerialize(): mixed $obj->version = self::VERSION; $obj->title = $this->title; - if (strlen($this->homePageUrl) > 0) { - $obj->home_page_url = $this->homePageUrl; + if (strlen($this->homePageUrl()) > 0) { + $obj->home_page_url = $this->homePageUrl(); } - if (strlen($this->feedUrl) > 0) { - $obj->feed_url = $this->feedUrl; + if (strlen($this->feedUrl()) > 0) { + $obj->feed_url = $this->feedUrl(); } - if (strlen($this->description) > 0) { - $obj->description = $this->description; + if (strlen($this->description()) > 0) { + $obj->description = $this->description(); } - if (strlen($this->userComment) > 0) { - $obj->user_comment = $this->userComment; + if (strlen($this->userComment()) > 0) { + $obj->user_comment = $this->userComment(); } - if (strlen($this->nextUrl) > 0) { - $obj->next_url = $this->nextUrl; + if (strlen($this->nextUrl()) > 0) { + $obj->next_url = $this->nextUrl(); } - if (strlen($this->icon) > 0) { - $obj->icon = $this->icon; + if (strlen($this->icon()) > 0) { + $obj->icon = $this->icon(); } - if (strlen($this->favicon) > 0) { - $obj->favicon = $this->favicon; + if (strlen($this->favicon()) > 0) { + $obj->favicon = $this->favicon(); } if (isset($this->authors)) { $obj->authors = $this->authors; } - if (strlen($this->language) > 0) { - $obj->language = $this->language; + if (strlen($this->language()) > 0) { + $obj->language = $this->language(); } if ($this->isExpired) { diff --git a/src/Json/Item.php b/src/Json/Item.php index bf85023..b3edf1f 100644 --- a/src/Json/Item.php +++ b/src/Json/Item.php @@ -20,19 +20,19 @@ */ class Item implements JsonSerializable { - private string|ContentHtml $extraContent; + private string|Stringable|ContentHtml $extraContent; - private string $url = ''; + private string|Stringable $url = ''; - private string $externalUrl = ''; + private string|Stringable $externalUrl = ''; - private string $title = ''; + private string|Stringable $title = ''; - private string $summary = ''; + private string|Stringable $summary = ''; - private string $image = ''; + private string|Stringable $image = ''; - private string $bannerImage = ''; + private string|Stringable $bannerImage = ''; private DateTime $datePublished; @@ -41,11 +41,11 @@ class Item implements JsonSerializable private Authors $authors; /** - * @var string[] + * @var array */ private array $tags = []; - private string $language = ''; + private string|Stringable $language = ''; private Attachments $attachments; @@ -127,7 +127,7 @@ public function withAuthors(Authors $authors): self public function withTags(string|Stringable ...$tags): self { - $this->tags = $tags; + $this->tags = array_values($tags); return $this; } @@ -154,22 +154,67 @@ public function withExtensions(CustomObjects $customObjects): self return $this->withCustomObjects($customObjects); } + private function url(): string + { + return (string) $this->url; + } + + private function externalUrl(): string + { + return (string) $this->externalUrl; + } + + private function title(): string + { + return (string) $this->title; + } + + private function content(): string + { + return (string) $this->content; + } + + private function extraContent(): string + { + return (string) $this->extraContent; + } + + private function summary(): string + { + return (string) $this->summary; + } + + private function image(): string + { + return (string) $this->image; + } + + private function bannerImage(): string + { + return (string) $this->bannerImage; + } + + private function language(): string + { + return (string) $this->language; + } + /** JsonSerializable **/ public function jsonSerialize(): mixed { $obj = new StdClass(); $obj->id = $this->id; - if (strlen($this->url) > 0) { - $obj->url = $this->url; + if (strlen($this->url()) > 0) { + $obj->url = $this->url(); } - if (strlen($this->externalUrl) > 0) { - $obj->external_url = $this->externalUrl; + if (strlen($this->externalUrl()) > 0) { + $obj->external_url = $this->externalUrl(); } - if (strlen($this->title) > 0) { - $obj->title = $this->title; + if (strlen($this->title()) > 0) { + $obj->title = $this->title(); } if ( @@ -179,7 +224,7 @@ public function jsonSerialize(): mixed $obj->content_html = (string) $this->content; } else { - $obj->content_text = $this->content; + $obj->content_text = $this->content(); } @@ -191,21 +236,21 @@ public function jsonSerialize(): mixed $obj->content_html = (string) $this->extraContent; } else { - $obj->content_text = $this->extraContent; + $obj->content_text = $this->extraContent(); } } - if (strlen($this->summary) > 0) { - $obj->summary = $this->summary; + if (strlen($this->summary()) > 0) { + $obj->summary = $this->summary(); } - if (strlen($this->image) > 0) { - $obj->image = $this->image; + if (strlen($this->image()) > 0) { + $obj->image = $this->image(); } - if (strlen($this->bannerImage) > 0) { - $obj->banner_image = $this->bannerImage; + if (strlen($this->bannerImage()) > 0) { + $obj->banner_image = $this->bannerImage(); } if (isset($this->datePublished)) { @@ -224,8 +269,8 @@ public function jsonSerialize(): mixed $obj->tags = $this->tags; } - if (strlen($this->language) > 0) { - $obj->language = $this->language; + if (strlen($this->language()) > 0) { + $obj->language = $this->language(); } if (isset($this->attachments)) { From ee5bbff050ff897b14509b3a0f32968ed66bf542 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 29 Mar 2024 19:59:49 -0400 Subject: [PATCH 11/14] update: Comment --- src/Atom/Document.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Atom/Document.php b/src/Atom/Document.php index 09acab7..5f4ce0c 100644 --- a/src/Atom/Document.php +++ b/src/Atom/Document.php @@ -130,6 +130,9 @@ public function withSubtitle(Subtitle $subtitle): self return $this; } + /** + * Atom feeds MUST have at least one listed author. + */ private function passesAuthorCheck(): bool { if ($this->authors !== null) { From e0c10309067f8bc319916bde08ca1c585d194267 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 29 Mar 2024 20:00:50 -0400 Subject: [PATCH 12/14] update: PHP 8.2 actions --- .github/workflows/php82.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/php82.yml diff --git a/.github/workflows/php82.yml b/.github/workflows/php82.yml new file mode 100644 index 0000000..22b289e --- /dev/null +++ b/.github/workflows/php82.yml @@ -0,0 +1,34 @@ +name: PHP 8.2 + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP Action + uses: shivammathur/setup-php@2.15.0 + with: + php-version: '8.2' + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run style check + run: composer run style + + - name: Run static analyzer + run: composer run stan + + - name: Run tests + run: composer run test From 7077e636d4e5771f2065d8fd2ba4d3c61bcc426a Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 29 Mar 2024 20:01:12 -0400 Subject: [PATCH 13/14] update: Composer PHP versions --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bcebef0..669fe84 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "support": { }, "require": { - "php": "^8.1", + "php": "^8.1 | ^ 8.2", "8fold/php-xml-builder": "^2.0" }, "require-dev": { From 2afa0529a3fd703a47babbfd97599eb6a772414e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 29 Mar 2024 20:02:43 -0400 Subject: [PATCH 14/14] update: Dependencies for PHP versions --- composer.json | 2 +- composer.lock | 172 ++++++++++++++++++++++++++------------------------ 2 files changed, 92 insertions(+), 82 deletions(-) diff --git a/composer.json b/composer.json index 669fe84..1f480cf 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "support": { }, "require": { - "php": "^8.1 | ^ 8.2", + "php": "^8.1 | ^8.2", "8fold/php-xml-builder": "^2.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 3e5865e..13b4d15 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "90647e95d3d62cad945ba92fcd5371c5", + "content-hash": "f70927cced744efb1f59bee055e2209a", "packages": [ { "name": "8fold/php-xml-builder", @@ -124,25 +124,27 @@ }, { "name": "nikic/php-parser", - "version": "v4.18.0", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -150,7 +152,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -174,26 +176,27 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2023-12-10T21:03:43+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -234,9 +237,15 @@ "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" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -291,16 +300,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.50", + "version": "1.10.66", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4" + "reference": "94779c987e4ebd620025d9e5fdd23323903950bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/06a98513ac72c03e8366b5a0cb00750b487032e4", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/94779c987e4ebd620025d9e5fdd23323903950bd", + "reference": "94779c987e4ebd620025d9e5fdd23323903950bd", "shasum": "" }, "require": { @@ -349,20 +358,20 @@ "type": "tidelift" } ], - "time": "2023-12-13T10:59:42+00:00" + "time": "2024-03-28T16:17:31+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.1.11", + "version": "10.1.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145" + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", "shasum": "" }, "require": { @@ -419,7 +428,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14" }, "funding": [ { @@ -427,7 +436,7 @@ "type": "github" } ], - "time": "2023-12-21T15:38:30+00:00" + "time": "2024-03-12T15:33:41+00:00" }, { "name": "phpunit/php-file-iterator", @@ -674,16 +683,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.3", + "version": "10.5.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "6fce887c71076a73f32fd3e0774a6833fc5c7f19" + "reference": "18f8d4a5f52b61fdd9370aaae3167daa0eeb69cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6fce887c71076a73f32fd3e0774a6833fc5c7f19", - "reference": "6fce887c71076a73f32fd3e0774a6833fc5c7f19", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/18f8d4a5f52b61fdd9370aaae3167daa0eeb69cd", + "reference": "18f8d4a5f52b61fdd9370aaae3167daa0eeb69cd", "shasum": "" }, "require": { @@ -755,7 +764,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.3" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.16" }, "funding": [ { @@ -771,20 +780,20 @@ "type": "tidelift" } ], - "time": "2023-12-13T07:25:23+00:00" + "time": "2024-03-28T10:08:10+00:00" }, { "name": "sebastian/cli-parser", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { @@ -819,7 +828,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -827,7 +837,7 @@ "type": "github" } ], - "time": "2023-02-03T06:58:15+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", @@ -1077,16 +1087,16 @@ }, { "name": "sebastian/diff", - "version": "5.1.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { @@ -1094,7 +1104,7 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, "type": "library", "extra": { @@ -1132,7 +1142,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -1140,20 +1150,20 @@ "type": "github" } ], - "time": "2023-12-22T10:55:06+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", - "version": "6.0.1", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { @@ -1168,7 +1178,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -1196,7 +1206,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -1204,20 +1214,20 @@ "type": "github" } ], - "time": "2023-04-11T05:39:26+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", - "version": "5.1.1", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { @@ -1274,7 +1284,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -1282,20 +1292,20 @@ "type": "github" } ], - "time": "2023-09-24T13:22:09+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { @@ -1329,14 +1339,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -1344,7 +1354,7 @@ "type": "github" } ], - "time": "2023-07-19T07:19:23+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", @@ -1690,16 +1700,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "shasum": "" }, "require": { @@ -1709,11 +1719,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -1766,20 +1776,20 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-02-16T15:06:51+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -1808,7 +1818,7 @@ "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.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -1816,7 +1826,7 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], @@ -1825,7 +1835,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.1" + "php": "^8.1 | ^8.2" }, "platform-dev": [], "plugin-api-version": "2.3.0"