From 3428cd6ba32a783cfec514ddb86c84e6748e2355 Mon Sep 17 00:00:00 2001 From: Hexydec Date: Thu, 15 Sep 2022 22:39:33 +0100 Subject: [PATCH] Fixed issue in autoload.php where the return type was incorrect. Fixed issues with docblocks. Added stability badge to readme.md. --- composer.json | 8 +- composer.lock | 500 +++++---------------------------------- readme.md | 1 + src/autoload.php | 5 +- src/helpers/selector.php | 19 +- src/htmldoc.php | 4 +- src/tokens/custom.php | 4 +- src/tokens/tag.php | 6 +- 8 files changed, 94 insertions(+), 453 deletions(-) diff --git a/composer.json b/composer.json index c2d88b0..137d96d 100644 --- a/composer.json +++ b/composer.json @@ -13,14 +13,14 @@ "minimum-stability": "stable", "require": { "php": ">=7.4", - "hexydec/tokenise": "1.0.0", - "hexydec/cssdoc": "1.0.2", - "hexydec/jslite": "0.6.0" + "hexydec/tokenise": "1.0.1", + "hexydec/cssdoc": "1.0.3", + "hexydec/jslite": "0.6.1" }, "autoload": { "classmap": ["src/"] }, "require-dev": { - "phpunit/phpunit": "9.5" + "phpunit/phpunit": "9.5.24" } } diff --git a/composer.lock b/composer.lock index feab29c..4739c06 100644 --- a/composer.lock +++ b/composer.lock @@ -4,24 +4,24 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "26281eace70b67b1b4c75d48e588b29b", + "content-hash": "07a41cb8679aae918c1d8d823b8df21a", "packages": [ { "name": "hexydec/cssdoc", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/hexydec/cssdoc.git", - "reference": "11248a9486aceccf9159a1d4c83facb1bb8f618b" + "reference": "b71d2186f81822645e7fdb8f19d0e3e86417b243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hexydec/cssdoc/zipball/11248a9486aceccf9159a1d4c83facb1bb8f618b", - "reference": "11248a9486aceccf9159a1d4c83facb1bb8f618b", + "url": "https://api.github.com/repos/hexydec/cssdoc/zipball/b71d2186f81822645e7fdb8f19d0e3e86417b243", + "reference": "b71d2186f81822645e7fdb8f19d0e3e86417b243", "shasum": "" }, "require": { - "hexydec/tokenise": "1.0.0", + "hexydec/tokenise": "1.0.1", "php": ">=7.4" }, "require-dev": { @@ -47,26 +47,26 @@ "description": "A token based CSS Document parser and minifier written in PHP", "support": { "issues": "https://github.com/hexydec/cssdoc/issues", - "source": "https://github.com/hexydec/cssdoc/tree/1.0.2" + "source": "https://github.com/hexydec/cssdoc/tree/1.0.3" }, - "time": "2022-05-19T15:45:48+00:00" + "time": "2022-09-15T21:03:15+00:00" }, { "name": "hexydec/jslite", - "version": "0.6.0", + "version": "0.6.1", "source": { "type": "git", "url": "https://github.com/hexydec/jslite.git", - "reference": "d6e18f28d4660382824fb317d2ba05732d040422" + "reference": "41f9c7c1460fd6f8f4f696921593343bcfac639d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hexydec/jslite/zipball/d6e18f28d4660382824fb317d2ba05732d040422", - "reference": "d6e18f28d4660382824fb317d2ba05732d040422", + "url": "https://api.github.com/repos/hexydec/jslite/zipball/41f9c7c1460fd6f8f4f696921593343bcfac639d", + "reference": "41f9c7c1460fd6f8f4f696921593343bcfac639d", "shasum": "" }, "require": { - "hexydec/tokenise": "1.0.0", + "hexydec/tokenise": "1.0.1", "php": ">=7.4" }, "require-dev": { @@ -92,22 +92,22 @@ "description": "A token based Javascript parser/minifier designed for compressing inline scripts on the fly, written in PHP", "support": { "issues": "https://github.com/hexydec/jslite/issues", - "source": "https://github.com/hexydec/jslite/tree/0.6.0" + "source": "https://github.com/hexydec/jslite/tree/0.6.1" }, - "time": "2022-05-19T16:13:43+00:00" + "time": "2022-09-15T20:11:14+00:00" }, { "name": "hexydec/tokenise", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/hexydec/tokenise.git", - "reference": "bcb60c1efdf414d3849cad27d4ad44727660231e" + "reference": "51f2f476fabb77c0033df3fd51d6e36dae446a97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hexydec/tokenise/zipball/bcb60c1efdf414d3849cad27d4ad44727660231e", - "reference": "bcb60c1efdf414d3849cad27d4ad44727660231e", + "url": "https://api.github.com/repos/hexydec/tokenise/zipball/51f2f476fabb77c0033df3fd51d6e36dae446a97", + "reference": "51f2f476fabb77c0033df3fd51d6e36dae446a97", "shasum": "" }, "require": { @@ -136,9 +136,9 @@ "description": "A program for performing lexical analysis, written in PHP", "support": { "issues": "https://github.com/hexydec/tokenise/issues", - "source": "https://github.com/hexydec/tokenise/tree/1.0.0" + "source": "https://github.com/hexydec/tokenise/tree/1.0.1" }, - "time": "2022-03-04T22:57:24+00:00" + "time": "2022-09-15T19:52:08+00:00" } ], "packages-dev": [ @@ -273,16 +273,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "v4.15.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", "shasum": "" }, "require": { @@ -323,9 +323,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" }, - "time": "2021-11-30T19:35:32+00:00" + "time": "2022-09-04T07:30:47+00:00" }, { "name": "phar-io/manifest", @@ -438,252 +438,25 @@ }, "time": "2022-02-21T01:04:05+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.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "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.6.1" - }, - "time": "2022-03-15T21:29:03+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": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -732,7 +505,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" }, "funding": [ { @@ -740,7 +513,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-08-30T12:24:04+00:00" }, { "name": "phpunit/php-file-iterator", @@ -985,16 +758,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.0", + "version": "9.5.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe" + "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", - "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", + "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", "shasum": "" }, "require": { @@ -1006,11 +779,10 @@ "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.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.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", @@ -1024,13 +796,9 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3", + "sebastian/type": "^3.1", "sebastian/version": "^3.0.2" }, - "require-dev": { - "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -1072,11 +840,11 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24" }, "funding": [ { - "url": "https://phpunit.de/donate.html", + "url": "https://phpunit.de/sponsors.html", "type": "custom" }, { @@ -1084,7 +852,7 @@ "type": "github" } ], - "time": "2020-12-04T05:05:53+00:00" + "time": "2022-08-30T07:42:16+00:00" }, { "name": "sebastian/cli-parser", @@ -1255,16 +1023,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -1317,7 +1085,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -1325,7 +1093,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -1515,16 +1283,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -1580,7 +1348,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -1588,7 +1356,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -1943,28 +1711,28 @@ }, { "name": "sebastian/type", - "version": "2.3.4", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -1987,7 +1755,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -1995,7 +1763,7 @@ "type": "github" } ], - "time": "2021-06-15T12:49:02+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -2050,88 +1818,6 @@ ], "time": "2020-09-28T06:39:44+00:00" }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "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": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "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.25.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-10-20T20:35:02+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -2181,64 +1867,6 @@ } ], "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": [], diff --git a/readme.md b/readme.md index f23a641..f8c827e 100644 --- a/readme.md +++ b/readme.md @@ -3,6 +3,7 @@ A tokeniser based HTML document parser and minifier, written in PHP. [![Licence](https://img.shields.io/badge/Licence-MIT-lightgrey.svg)](LICENCE) +![Status: Stable](https://img.shields.io/badge/Status-Stable-Green.svg) [![Tests Status](https://github.com/hexydec/htmldoc/actions/workflows/tests.yml/badge.svg)](https://github.com/hexydec/htmldoc/actions/workflows/tests.yml) [![Code Coverage](https://codecov.io/gh/hexydec/htmldoc/branch/master/graph/badge.svg)](https://app.codecov.io/gh/hexydec/htmldoc) diff --git a/src/autoload.php b/src/autoload.php index e01ed27..ea109c9 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -1,5 +1,5 @@ __DIR__.'/htmldoc.php', 'hexydec\\html\\config' => __DIR__.'/config.php', @@ -14,7 +14,6 @@ 'hexydec\\html\\selector' => __DIR__.'/helpers/selector.php' ]; if (isset($classes[$class])) { - return (bool) require($classes[$class]); + require($classes[$class]); } - return false; }); diff --git a/src/helpers/selector.php b/src/helpers/selector.php index d2cf11b..8f12f7b 100644 --- a/src/helpers/selector.php +++ b/src/helpers/selector.php @@ -6,7 +6,7 @@ class selector { /** - * @var array $selectors Regexp components keyed by their corresponding codename for tokenising CSS selectors + * @var array $selectors Regexp components keyed by their corresponding codename for tokenising CSS selectors */ protected static array $tokens = [ 'quotes' => '(? '\s++', ]; + /** + * Get a selector string parsed into an array + * + * @param string $selector The CSS selector string to parse + * @return array|false An array of selector components or false if the selector was not parsable + */ public function get(string $selector) { $tokens = new tokenise(self::$tokens, \trim($selector)); return $this->parse($tokens); @@ -32,7 +38,7 @@ public function get(string $selector) { /** * Parses a CSS selector string * - * @param string $selector The CSS selector string to parse + * @param tokenise $tokens A tokenise object loaded with the selector to parse * @return array|bool An array of selector components */ public function parse(tokenise $tokens) { @@ -114,7 +120,14 @@ public function parse(tokenise $tokens) { return false; } - protected function parseAttributes(tokenise $tokens, ?string $join = null) { + /** + * Parses the attributes of a CSS selector + * + * @param tokenise $tokens A tokenise object loaded with the selector to be parsed + * @param ?string $join The joining command from the last CSS selector component + * @return array An array representing the attribute + */ + protected function parseAttributes(tokenise $tokens, ?string $join = null) : array { $item = ['join' => $join, 'sensitive' => true]; while (($token = $tokens->next()) !== null && $token['type'] !== 'squareclose') { diff --git a/src/htmldoc.php b/src/htmldoc.php index be664c2..71f4b4f 100644 --- a/src/htmldoc.php +++ b/src/htmldoc.php @@ -149,9 +149,9 @@ public function current() { /** * Retrieve the the current pointer position for the object * - * @return scalar The current pointer position + * @return mixed The current pointer position */ - public function key() : int { + public function key() { return $this->pointer; } diff --git a/src/tokens/custom.php b/src/tokens/custom.php index 0ee4fb0..9507a20 100644 --- a/src/tokens/custom.php +++ b/src/tokens/custom.php @@ -24,9 +24,9 @@ class custom implements token { * Constructs the script object * * @param htmldoc $root The parent htmldoc object - * @param string $tag The name of the custom tag, note this cannot be null + * @param string $tagName A string specifying the parent tag name */ - public function __construct(htmldoc $root, string $tagName = null) { + public function __construct(htmldoc $root, ?string $tagName = null) { $this->tagName = $tagName = \mb_strtolower($tagName ?? ''); $this->config = $root->config['custom'][$tagName]; } diff --git a/src/tokens/tag.php b/src/tokens/tag.php index 98d252e..f3b2863 100644 --- a/src/tokens/tag.php +++ b/src/tokens/tag.php @@ -216,7 +216,7 @@ protected function getParentTagNames() : array { * Parses an array of tokens into an HTML documents * * @param tokenise &$tokens A reference to an array of tokens generated by tokenise(), the reference allows the array pointer to pass between objectsS - * @return bool Whether the parser was able to capture any objects + * @return array An array of child objects */ public function parseChildren(tokenise $tokens) : array { $root = $this->root; @@ -382,7 +382,7 @@ public function after(array $nodes) : void { /** * Remove the selected child from the object * - * @param tag $child The child object to delete + * @param tag $node The child object to delete * @return void */ public function remove(tag $node) : void { @@ -628,7 +628,7 @@ protected function hasAttribute(array $attr, array $items) { * Determine whether this tag or any of its child tokens match a selector * * @param array $selector An array of CSS selectors - * @param array $searchChildren Denotes whether to search child tags as well as this tag + * @param bool $searchChildren Denotes whether to search child tags as well as this tag * @return array An array of tag objects that match $selector */ public function find(array $selector, bool $searchChildren = true) : array {