From 3bad9f59fa410e064d300b0029726814dd76ea33 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Dec 2021 12:10:09 -0600 Subject: [PATCH 1/7] re-engineer: First test conversion --- composer.json | 9 +- composer.lock | 2291 ++++++++++++++++++++++++ phpstan.neon | 2 +- src/Document.php | 14 +- tests/DocumentBaselineTest.php | 148 +- tests/ElementBaselineTest.php | 74 +- tests/ElementExtensionBaselineTest.php | 28 +- tests/PerformanceTest.php | 258 +-- 8 files changed, 2572 insertions(+), 252 deletions(-) create mode 100644 composer.lock diff --git a/composer.json b/composer.json index 2ef67c9..f2bba5d 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,9 @@ "8fold/php-xml-builder": "^0.6" }, "require-dev": { - "squizlabs/php_codesniffer": "^3.6", - "phpstan/phpstan": "^0.12", - "pestphp/pest": "^1.20", - "psr/log": "^1.0.1" + "squizlabs/php_codesniffer": "^3.6.0", + "phpstan/phpstan": "^1.2.0", + "phpunit/phpunit": "^9.5.0" }, "autoload": { "psr-4": { @@ -38,6 +37,6 @@ "production": ["@style", "@stan", "@test"], "style": "./vendor/bin/phpcs --standard=phpcs.xml -p ./src", "stan": "./vendor/bin/phpstan analyze", - "test": "./vendor/bin/pest" + "test": "./vendor/bin/phpunit" } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..5a1db85 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2291 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "51c40c01d5eb4513135c361804c02898", + "packages": [ + { + "name": "8fold/php-xml-builder", + "version": "0.6.3", + "source": { + "type": "git", + "url": "https://github.com/8fold/php-xml-builder.git", + "reference": "1b8665052f0a8341797e36c91a8767ca03d519c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/8fold/php-xml-builder/zipball/1b8665052f0a8341797e36c91a8767ca03d519c7", + "reference": "1b8665052f0a8341797e36c91a8767ca03d519c7", + "shasum": "" + }, + "require": { + "php": "^7.4||^8.0" + }, + "require-dev": { + "pestphp/pest": "^1.20", + "phpstan/phpstan": "^0.12", + "psr/log": "^1.0.1", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Eightfold\\XMLBuilder\\": "./src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Josh Bruce", + "email": "josh@8fold.pro" + } + ], + "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/0.6.3" + }, + "funding": [ + { + "url": "https://github.com/8fold", + "type": "github" + }, + { + "url": "https://github.com/joshbruce", + "type": "github" + } + ], + "time": "2021-10-17T20:02:11+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.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": "2020-11-10T18:47:58+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + }, + "time": "2021-10-02T14:08:47+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", + "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2021-11-18T14:09:01+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-05T09:12:13+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "2406855036db1102126125537adb1406f7242fdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", + "reference": "2406855036db1102126125537adb1406f7242fdd", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "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.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-25T07:07:57+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.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" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.6.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "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", + "keywords": [ + "phpcs", + "standards" + ], + "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": "2021-12-12T21:44:58+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^7.4||^8.0" + }, + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/phpstan.neon b/phpstan.neon index 59a23ba..5ba97e5 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,5 @@ parameters: - level: 8 + level: 9 paths: - src ignoreErrors: diff --git a/src/Document.php b/src/Document.php index 169d9a1..642b4b1 100644 --- a/src/Document.php +++ b/src/Document.php @@ -20,7 +20,7 @@ class Document implements Buildable private array $head = []; /** - * @var array + * @var array */ private array $body = []; @@ -44,9 +44,9 @@ final public function __construct( // TODO: PHP8 - Element|Comment /** - * @param Element|Comment $content [description] + * @param Element|Comment $content */ - public function head(...$content): Document + public function head(Element|Comment ...$content): Document { $this->head = $content; return $this; @@ -54,9 +54,9 @@ public function head(...$content): Document // TODO: PHP8 - Element|Comment /** - * @param Element|Comment|string $content [description] + * @param Element|Comment|string $content */ - public function body(...$content): Document + public function body(Element|Comment|string ...$content): Document { $this->body = $content; return $this; @@ -96,7 +96,7 @@ private function charset(): string } /** - * @return array $content [description] + * @return array $content */ private function headContent(): array { @@ -104,7 +104,7 @@ private function headContent(): array } /** - * @return array $content [description] + * @return array $content */ private function bodyContent(): array { diff --git a/tests/DocumentBaselineTest.php b/tests/DocumentBaselineTest.php index 6170f6d..b366bfc 100644 --- a/tests/DocumentBaselineTest.php +++ b/tests/DocumentBaselineTest.php @@ -1,73 +1,103 @@ head( - Element::link() - ->omitEndTag()->props('rel stylesheet', 'href style.css'), - Element::script()->props('src script.js') - )->body( - Element::p('paragraph content') - ) - )->toBe('' . "\n" . 'title' . - '' . - '

paragraph content

' - ); -}); +class DocumentBaselineTest extends TestCase +{ + /** + * @test + */ + public function document_is_stringable(): void // phpcs:ignore + { + $expected = << + title

paragraph content

+ html; -test('Docment can have body', function() { - expect( - Document::create('title', 'fr', 'ascii') + $result = (string) Document::create('title', 'fr', 'ascii') ->head( Element::link() ->omitEndTag()->props('rel stylesheet', 'href style.css'), Element::script()->props('src script.js') )->body( Element::p('paragraph content') - )->build() - )->toBe('' . "\n" . 'title' . - '' . - '

paragraph content

' - ); -}); - -test('Docment can have head', function() { - expect( - Document::create('title', 'fr', 'ascii') - ->head( - Element::link() - ->omitEndTag()->props('rel stylesheet', 'href style.css'), - Element::script()->props('src script.js') - )->build() - )->toBe('' . "\n" . 'title' . - '' . - '' - ); -}); - -test('Docment can change language and character set', function() { - expect( - Document::create('title', 'fr', 'ascii')->build() - )->toBe('' . "\n" . 'title' . - '' - ); -}); - -test('Docment has baseline', function() { - expect( - Document::create('title')->build() - )->toBe('' . "\n" . 'title' . - '' - ); -}); + ); -test('Document exists', function() { - $this->assertTrue( - class_exists(Document::class) - ); -}); + $this->assertSame($expected, $result); + } +} +// +// test('Docment is stringable', function() { +// expect( + // (string) Document::create('title', 'fr', 'ascii') + // ->head( + // Element::link() + // ->omitEndTag()->props('rel stylesheet', 'href style.css'), + // Element::script()->props('src script.js') + // )->body( + // Element::p('paragraph content') + // ) + // )->toBe('' . "\n" . 'title' . + // '' . + // '

paragraph content

' +// ); +// }); +// +// test('Docment can have body', function() { +// expect( +// Document::create('title', 'fr', 'ascii') +// ->head( +// Element::link() +// ->omitEndTag()->props('rel stylesheet', 'href style.css'), +// Element::script()->props('src script.js') +// )->body( +// Element::p('paragraph content') +// )->build() +// )->toBe('' . "\n" . 'title' . +// '' . +// '

paragraph content

' +// ); +// }); +// +// test('Docment can have head', function() { +// expect( +// Document::create('title', 'fr', 'ascii') +// ->head( +// Element::link() +// ->omitEndTag()->props('rel stylesheet', 'href style.css'), +// Element::script()->props('src script.js') +// )->build() +// )->toBe('' . "\n" . 'title' . +// '' . +// '' +// ); +// }); +// +// test('Docment can change language and character set', function() { +// expect( +// Document::create('title', 'fr', 'ascii')->build() +// )->toBe('' . "\n" . 'title' . +// '' +// ); +// }); +// +// test('Docment has baseline', function() { +// expect( +// Document::create('title')->build() +// )->toBe('' . "\n" . 'title' . +// '' +// ); +// }); +// +// test('Document exists', function() { +// $this->assertTrue( +// class_exists(Document::class) +// ); +// }); diff --git a/tests/ElementBaselineTest.php b/tests/ElementBaselineTest.php index 67b3eec..38aa1f6 100644 --- a/tests/ElementBaselineTest.php +++ b/tests/ElementBaselineTest.php @@ -2,40 +2,40 @@ use Eightfold\HTMLBuilder\Element; -test('Element can have empty props', function() { - expect( - (string) Element::a('link')->props('') - )->toBe(<<link - html - ); -}); - -test('Element has ordered properties', function() { - expect( - Element::a('link') - ->props( - 'required required', - 'href https://8fold.pro', - 'class some-style', - 'id unique', - 'data-testing test' - )->build() - )->toBe( - 'link' - ); -}); - -test('Element has correct self-closing string', function() { - expect( - Element::tag()->omitEndTag()->build() - )->toBe( - '' - ); -}); - -test('Element exists', function() { - $this->assertTrue( - class_exists(Element::class) - ); -}); +// test('Element can have empty props', function() { +// expect( +// (string) Element::a('link')->props('') +// )->toBe(<<link +// html +// ); +// }); +// +// test('Element has ordered properties', function() { +// expect( +// Element::a('link') +// ->props( +// 'required required', +// 'href https://8fold.pro', +// 'class some-style', +// 'id unique', +// 'data-testing test' +// )->build() +// )->toBe( +// 'link' +// ); +// }); +// +// test('Element has correct self-closing string', function() { +// expect( +// Element::tag()->omitEndTag()->build() +// )->toBe( +// '' +// ); +// }); +// +// test('Element exists', function() { +// $this->assertTrue( +// class_exists(Element::class) +// ); +// }); diff --git a/tests/ElementExtensionBaselineTest.php b/tests/ElementExtensionBaselineTest.php index 289ab5b..13f353d 100644 --- a/tests/ElementExtensionBaselineTest.php +++ b/tests/ElementExtensionBaselineTest.php @@ -2,17 +2,17 @@ use Eightfold\HTMLBuilder\Tests\Extensions\ElementExtension; -test('Element has ordered properties', function() { - expect( - ElementExtension::a('link') - ->props( - 'required required', - 'href https://8fold.pro', - 'class some-style', - 'id unique', - 'data-testing test' - )->build() - )->toBe( - 'link' - ); -}); +// test('Element has ordered properties', function() { +// expect( +// ElementExtension::a('link') +// ->props( +// 'required required', +// 'href https://8fold.pro', +// 'class some-style', +// 'id unique', +// 'data-testing test' +// )->build() +// )->toBe( +// 'link' +// ); +// }); diff --git a/tests/PerformanceTest.php b/tests/PerformanceTest.php index 090ad50..fb2848f 100644 --- a/tests/PerformanceTest.php +++ b/tests/PerformanceTest.php @@ -6,132 +6,132 @@ use Eightfold\HTMLBuilder\Element; -test('Document is speedy', function() { - $start = hrtime(true); - - $head = []; - for ($i = 0; $i < 10; $i++) { - if ($i > 2 and $i < 8) { - $head[] = Comment::create($i); - - } - - $head[] = Element::meta()->props("id {$i}"); - } - - $body = []; - for ($i = 0; $i < 10; $i++) { - if ($i > 1 and $i < 9) { - $body[] = Comment::create($i); - - } - - $body[] = Element::p("Hello, {$i}!"); - } - - $result = (string) Document::create('title of my site') - ->head(...$head) - ->body(...$body); - - $end = hrtime(true); - - expect($result)->toBe(<< - title of my site - - - - - - - - - -

Hello, 0!

Hello, 1!

- -

Hello, 2!

- -

Hello, 3!

- -

Hello, 4!

- -

Hello, 5!

- -

Hello, 6!

- -

Hello, 7!

- -

Hello, 8!

Hello, 9!

- doc - ); - - $elapsed = $end - $start; - $ms = $elapsed/1e+6; - - expect($ms)->toBeLessThan(1); -}); - -test('Document is small', function() { - $start = memory_get_usage(); - - $head = []; - for ($i = 0; $i < 10; $i++) { - if ($i > 2 and $i < 8) { - $head[] = Comment::create($i); - - } - - $head[] = Element::meta()->props("id {$i}"); - } - - $body = []; - for ($i = 0; $i < 10; $i++) { - if ($i > 1 and $i < 9) { - $body[] = Comment::create($i); - - } - - $body[] = Element::p("Hello, {$i}!"); - } - - $result = (string) Document::create('title of my site') - ->head(...$head) - ->body(...$body); - - $end = memory_get_usage(); - - expect($result)->toBe(<< - title of my site - - - - - - - - - -

Hello, 0!

Hello, 1!

- -

Hello, 2!

- -

Hello, 3!

- -

Hello, 4!

- -

Hello, 5!

- -

Hello, 6!

- -

Hello, 7!

- -

Hello, 8!

Hello, 9!

- doc - ); - - $used = $end - $start; - $kb = round($used/1024.2); - - expect($kb)->toBeLessThan(15); -}); +// test('Document is speedy', function() { +// $start = hrtime(true); +// +// $head = []; +// for ($i = 0; $i < 10; $i++) { +// if ($i > 2 and $i < 8) { +// $head[] = Comment::create($i); +// +// } +// +// $head[] = Element::meta()->props("id {$i}"); +// } +// +// $body = []; +// for ($i = 0; $i < 10; $i++) { +// if ($i > 1 and $i < 9) { +// $body[] = Comment::create($i); +// +// } +// +// $body[] = Element::p("Hello, {$i}!"); +// } +// +// $result = (string) Document::create('title of my site') +// ->head(...$head) +// ->body(...$body); +// +// $end = hrtime(true); +// +// expect($result)->toBe(<< +// title of my site +// +// +// +// +// +// +// +// +// +//

Hello, 0!

Hello, 1!

+// +//

Hello, 2!

+// +//

Hello, 3!

+// +//

Hello, 4!

+// +//

Hello, 5!

+// +//

Hello, 6!

+// +//

Hello, 7!

+// +//

Hello, 8!

Hello, 9!

+// doc +// ); +// +// $elapsed = $end - $start; +// $ms = $elapsed/1e+6; +// +// expect($ms)->toBeLessThan(1); +// }); +// +// test('Document is small', function() { +// $start = memory_get_usage(); +// +// $head = []; +// for ($i = 0; $i < 10; $i++) { +// if ($i > 2 and $i < 8) { +// $head[] = Comment::create($i); +// +// } +// +// $head[] = Element::meta()->props("id {$i}"); +// } +// +// $body = []; +// for ($i = 0; $i < 10; $i++) { +// if ($i > 1 and $i < 9) { +// $body[] = Comment::create($i); +// +// } +// +// $body[] = Element::p("Hello, {$i}!"); +// } +// +// $result = (string) Document::create('title of my site') +// ->head(...$head) +// ->body(...$body); +// +// $end = memory_get_usage(); +// +// expect($result)->toBe(<< +// title of my site +// +// +// +// +// +// +// +// +// +//

Hello, 0!

Hello, 1!

+// +//

Hello, 2!

+// +//

Hello, 3!

+// +//

Hello, 4!

+// +//

Hello, 5!

+// +//

Hello, 6!

+// +//

Hello, 7!

+// +//

Hello, 8!

Hello, 9!

+// doc +// ); +// +// $used = $end - $start; +// $kb = round($used/1024.2); +// +// expect($kb)->toBeLessThan(15); +// }); From 0f17ae705369294b33fda158a1d6cc3421625379 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Dec 2021 12:17:14 -0600 Subject: [PATCH 2/7] Update DocumentBaselineTest.php --- tests/DocumentBaselineTest.php | 150 ++++++++++++++++++--------------- 1 file changed, 82 insertions(+), 68 deletions(-) diff --git a/tests/DocumentBaselineTest.php b/tests/DocumentBaselineTest.php index b366bfc..0fdc027 100644 --- a/tests/DocumentBaselineTest.php +++ b/tests/DocumentBaselineTest.php @@ -32,72 +32,86 @@ public function document_is_stringable(): void // phpcs:ignore $this->assertSame($expected, $result); } + + /** + * @test + */ + public function document_can_have_body(): void // phpcs:ignore + { + $expected = << + title

paragraph content

+ html; + + $result = Document::create('title', 'fr', 'ascii') + ->head( + Element::link() + ->omitEndTag()->props('rel stylesheet', 'href style.css'), + Element::script()->props('src script.js') + )->body( + Element::p('paragraph content') + )->build(); + + $this->assertSame($expected, $result); + } + + /** + * @test + */ + public function document_can_have_head(): void // phpcs:ignore + { + $expected = << + title + html; + + $result = Document::create('title', 'fr', 'ascii') + ->head( + Element::link() + ->omitEndTag()->props('rel stylesheet', 'href style.css'), + Element::script()->props('src script.js') + )->build(); + + $this->assertSame($expected, $result); + } + + /** + * @test + */ + public function document_can_change_lang_and_char_set(): void // phpcs:ignore + { + $expected = << + title + html; + + $result = Document::create('title', 'fr', 'ascii')->build(); + + $this->assertSame($expected, $result); + } + + /** + * @test + */ + public function document_has_baseline(): void // phpcs:ignore + { + $expected = << + title + html; + + $result = Document::create('title')->build(); + + $this->assertSame($expected, $result); + } + + /** + * @test + */ + public function document_class_exists(): void // phpcs:ignore + { + $this->assertTrue( + class_exists(Document::class) + ); + } } -// -// test('Docment is stringable', function() { -// expect( - // (string) Document::create('title', 'fr', 'ascii') - // ->head( - // Element::link() - // ->omitEndTag()->props('rel stylesheet', 'href style.css'), - // Element::script()->props('src script.js') - // )->body( - // Element::p('paragraph content') - // ) - // )->toBe('' . "\n" . 'title' . - // '' . - // '

paragraph content

' -// ); -// }); -// -// test('Docment can have body', function() { -// expect( -// Document::create('title', 'fr', 'ascii') -// ->head( -// Element::link() -// ->omitEndTag()->props('rel stylesheet', 'href style.css'), -// Element::script()->props('src script.js') -// )->body( -// Element::p('paragraph content') -// )->build() -// )->toBe('' . "\n" . 'title' . -// '' . -// '

paragraph content

' -// ); -// }); -// -// test('Docment can have head', function() { -// expect( -// Document::create('title', 'fr', 'ascii') -// ->head( -// Element::link() -// ->omitEndTag()->props('rel stylesheet', 'href style.css'), -// Element::script()->props('src script.js') -// )->build() -// )->toBe('' . "\n" . 'title' . -// '' . -// '' -// ); -// }); -// -// test('Docment can change language and character set', function() { -// expect( -// Document::create('title', 'fr', 'ascii')->build() -// )->toBe('' . "\n" . 'title' . -// '' -// ); -// }); -// -// test('Docment has baseline', function() { -// expect( -// Document::create('title')->build() -// )->toBe('' . "\n" . 'title' . -// '' -// ); -// }); -// -// test('Document exists', function() { -// $this->assertTrue( -// class_exists(Document::class) -// ); -// }); From a36b8e06e1651098c95046baf84d4c1be4c6b059 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Dec 2021 12:54:05 -0600 Subject: [PATCH 3/7] tests: Element baseline --- tests/DocumentBaselineTest.php | 12 ++-- tests/ElementBaselineTest.php | 103 +++++++++++++++++++++------------ 2 files changed, 72 insertions(+), 43 deletions(-) diff --git a/tests/DocumentBaselineTest.php b/tests/DocumentBaselineTest.php index 0fdc027..d5a91fd 100644 --- a/tests/DocumentBaselineTest.php +++ b/tests/DocumentBaselineTest.php @@ -14,7 +14,7 @@ class DocumentBaselineTest extends TestCase /** * @test */ - public function document_is_stringable(): void // phpcs:ignore + public function is_stringable(): void // phpcs:ignore { $expected = << @@ -36,7 +36,7 @@ public function document_is_stringable(): void // phpcs:ignore /** * @test */ - public function document_can_have_body(): void // phpcs:ignore + public function can_have_body(): void // phpcs:ignore { $expected = << @@ -58,7 +58,7 @@ public function document_can_have_body(): void // phpcs:ignore /** * @test */ - public function document_can_have_head(): void // phpcs:ignore + public function can_have_head(): void // phpcs:ignore { $expected = << @@ -78,7 +78,7 @@ public function document_can_have_head(): void // phpcs:ignore /** * @test */ - public function document_can_change_lang_and_char_set(): void // phpcs:ignore + public function can_change_lang_and_char_set(): void // phpcs:ignore { $expected = << @@ -93,7 +93,7 @@ public function document_can_change_lang_and_char_set(): void // phpcs:ignore /** * @test */ - public function document_has_baseline(): void // phpcs:ignore + public function has_baseline(): void // phpcs:ignore { $expected = << @@ -108,7 +108,7 @@ public function document_has_baseline(): void // phpcs:ignore /** * @test */ - public function document_class_exists(): void // phpcs:ignore + public function class_exists(): void // phpcs:ignore { $this->assertTrue( class_exists(Document::class) diff --git a/tests/ElementBaselineTest.php b/tests/ElementBaselineTest.php index 38aa1f6..d2aa94a 100644 --- a/tests/ElementBaselineTest.php +++ b/tests/ElementBaselineTest.php @@ -1,41 +1,70 @@ props('') -// )->toBe(<<link -// html -// ); -// }); -// -// test('Element has ordered properties', function() { -// expect( -// Element::a('link') -// ->props( -// 'required required', -// 'href https://8fold.pro', -// 'class some-style', -// 'id unique', -// 'data-testing test' -// )->build() -// )->toBe( -// 'link' -// ); -// }); -// -// test('Element has correct self-closing string', function() { -// expect( -// Element::tag()->omitEndTag()->build() -// )->toBe( -// '' -// ); -// }); -// -// test('Element exists', function() { -// $this->assertTrue( -// class_exists(Element::class) -// ); -// }); +class ElementBaselineTest extends TestCase +{ + /** + * @test + */ + public function can_have_empty_props(): void // phpcs:ignore + { + $expected = <<link + html; + + $result = (string) Element::a('link')->props(''); + + $this->assertSame($expected, $result); + } + + /** + * @test + */ + public function has_ordered_properties(): void // phpcs:ignore + { + $expected = <<link + html; + + $result = Element::a('link') + ->props( + 'required required', + 'href https://8fold.pro', + 'class some-style', + 'id unique', + 'data-testing test' + )->build(); + + $this->assertSame($expected, $result); + } + + /** + * @test + */ + public function has_correct_selfclosing_string(): void // phpcs:ignore + { + $expected = << + html; + + $result = Element::tag()->omitEndTag()->build(); + + $this->assertSame($expected, $result); + } + + /** + * @test + */ + public function element_exists(): void // phpcs:ignore + { + $this->assertTrue( + class_exists(Element::class) + ); + } +} From 9655b0c0eddbcf9cbd788784f6c85e3f23171e25 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Dec 2021 12:56:27 -0600 Subject: [PATCH 4/7] Update ElementExtensionBaselineTest.php --- tests/ElementExtensionBaselineTest.php | 42 +++++++++++++++++--------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/tests/ElementExtensionBaselineTest.php b/tests/ElementExtensionBaselineTest.php index 13f353d..d95b283 100644 --- a/tests/ElementExtensionBaselineTest.php +++ b/tests/ElementExtensionBaselineTest.php @@ -1,18 +1,32 @@ props( -// 'required required', -// 'href https://8fold.pro', -// 'class some-style', -// 'id unique', -// 'data-testing test' -// )->build() -// )->toBe( -// 'link' -// ); -// }); +class ElementExtensionBaselineTest extends TestCase +{ + /** + * @test + */ + public function has_ordered_properties(): void // phpcs:ignore + { + $exptected = <<link + html; + + $result = ElementExtension::a('link') + ->props( + 'required required', + 'href https://8fold.pro', + 'class some-style', + 'id unique', + 'data-testing test' + )->build(); + + $this->assertSame($exptected, $result); + } +} From be642fbe04d929f99696c87bdd64d75aa21fab3d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Dec 2021 13:13:47 -0600 Subject: [PATCH 5/7] tests: All converted --- tests/PerformanceTest.php | 209 ++++++++++++++------------------------ tests/performance.html | 26 +++++ 2 files changed, 105 insertions(+), 130 deletions(-) create mode 100644 tests/performance.html diff --git a/tests/PerformanceTest.php b/tests/PerformanceTest.php index fb2848f..0f9343e 100644 --- a/tests/PerformanceTest.php +++ b/tests/PerformanceTest.php @@ -1,137 +1,86 @@ 2 and $i < 8) { -// $head[] = Comment::create($i); -// -// } -// -// $head[] = Element::meta()->props("id {$i}"); -// } -// -// $body = []; -// for ($i = 0; $i < 10; $i++) { -// if ($i > 1 and $i < 9) { -// $body[] = Comment::create($i); -// -// } -// -// $body[] = Element::p("Hello, {$i}!"); -// } -// -// $result = (string) Document::create('title of my site') -// ->head(...$head) -// ->body(...$body); -// -// $end = hrtime(true); -// -// expect($result)->toBe(<< -// title of my site -// -// -// -// -// -// -// -// -// -//

Hello, 0!

Hello, 1!

-// -//

Hello, 2!

-// -//

Hello, 3!

-// -//

Hello, 4!

-// -//

Hello, 5!

-// -//

Hello, 6!

-// -//

Hello, 7!

-// -//

Hello, 8!

Hello, 9!

-// doc -// ); -// -// $elapsed = $end - $start; -// $ms = $elapsed/1e+6; -// -// expect($ms)->toBeLessThan(1); -// }); -// -// test('Document is small', function() { -// $start = memory_get_usage(); -// -// $head = []; -// for ($i = 0; $i < 10; $i++) { -// if ($i > 2 and $i < 8) { -// $head[] = Comment::create($i); -// -// } -// -// $head[] = Element::meta()->props("id {$i}"); -// } -// -// $body = []; -// for ($i = 0; $i < 10; $i++) { -// if ($i > 1 and $i < 9) { -// $body[] = Comment::create($i); -// -// } -// -// $body[] = Element::p("Hello, {$i}!"); -// } -// -// $result = (string) Document::create('title of my site') -// ->head(...$head) -// ->body(...$body); -// -// $end = memory_get_usage(); -// -// expect($result)->toBe(<< -// title of my site -// -// -// -// -// -// -// -// -// -//

Hello, 0!

Hello, 1!

-// -//

Hello, 2!

-// -//

Hello, 3!

-// -//

Hello, 4!

-// -//

Hello, 5!

-// -//

Hello, 6!

-// -//

Hello, 7!

-// -//

Hello, 8!

Hello, 9!

-// doc -// ); -// -// $used = $end - $start; -// $kb = round($used/1024.2); -// -// expect($kb)->toBeLessThan(15); -// }); +class PerformanceTest extends TestCase +{ + private function head(): array + { + $head = []; + for ($i = 0; $i < 10; $i++) { + if ($i > 2 and $i < 8) { + $head[] = Comment::create(strval($i)); + } + $head[] = Element::meta()->props("id {$i}"); + } + return $head; + } + + private function body(): array + { + $body = []; + for ($i = 0; $i < 10; $i++) { + if ($i > 1 and $i < 9) { + $body[] = Comment::create(strval($i)); + } + $body[] = Element::p("Hello, {$i}!"); + } + return $body; + } + + /** + * @test + */ + public function document_is_speedy(): void // phpcs:ignore + { + $start = hrtime(true); + + $result = (string) Document::create('title of my site') + ->head(...$this->head()) + ->body(...$this->body()) . "\n"; + + $end = hrtime(true); + + $expected = file_get_contents(__DIR__ . '/performance.html'); + + $this->assertSame($expected, $result); + + $elapsed = $end - $start; + $ms = $elapsed/1e+6; + + $this->assertLessThan(1, $ms); + } + + /** + * @test + */ + public function document_is_small(): void // phpcs:ignore + { + $start = memory_get_usage(); + + $result = (string) Document::create('title of my site') + ->head(...$this->head()) + ->body(...$this->body()) . "\n"; + + $end = memory_get_peak_usage(); + + $expected = file_get_contents(__DIR__ . '/performance.html'); + + $this->assertSame($expected, $result); + + $used = $end - $start; + $kb = round($used/1024.2); + + $this->assertLessThan(53, $kb); + } +} diff --git a/tests/performance.html b/tests/performance.html new file mode 100644 index 0000000..5d1e867 --- /dev/null +++ b/tests/performance.html @@ -0,0 +1,26 @@ + +title of my site + + + + + + + + + +

Hello, 0!

Hello, 1!

+ +

Hello, 2!

+ +

Hello, 3!

+ +

Hello, 4!

+ +

Hello, 5!

+ +

Hello, 6!

+ +

Hello, 7!

+ +

Hello, 8!

Hello, 9!

From 0996cd0033c36d7d3f85178bcb6f08d4a3b16ca1 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Dec 2021 13:15:48 -0600 Subject: [PATCH 6/7] BREAKING CHANGE: Require PHP 8 --- .github/workflows/php.yml | 33 --------------------------------- composer.json | 2 +- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml deleted file mode 100644 index e58325f..0000000 --- a/.github/workflows/php.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: PHP 7.4 - -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: '7.4' - - - 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 diff --git a/composer.json b/composer.json index f2bba5d..ced7cfe 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^7.4||^8.0", + "php": "^8.0", "8fold/php-xml-builder": "^0.6" }, "require-dev": { From 5b72278c2d8cb5d72e208cef204828a358c2b432 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 25 Dec 2021 13:18:04 -0600 Subject: [PATCH 7/7] Update composer.lock --- composer.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index 5a1db85..b85f7ef 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": "51c40c01d5eb4513135c361804c02898", + "content-hash": "715d9854d12bef8eec0f17dfa7024517", "packages": [ { "name": "8fold/php-xml-builder", @@ -2284,7 +2284,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.4||^8.0" + "php": "^8.0" }, "platform-dev": [], "plugin-api-version": "2.1.0"