diff --git a/.gitignore b/.gitignore index d14f26b..c4d2963 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ nbproject/ /apidoc/ error_log.txt node_modules/ -composer.lock npm-debug.log build/ localsettings.php diff --git a/.travis.yml b/.travis.yml index 4dbde0e..edf9afe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: php php: - - 7.1 - - 7.2 - - 7.3 + - 8.2 + - 8.3 + - 8.4 install: - composer self-update - composer install --no-interaction --dev diff --git a/composer.json b/composer.json index 00a9a9b..7de048a 100644 --- a/composer.json +++ b/composer.json @@ -6,9 +6,9 @@ "type": "library", "authors": [ { - "name": "Xenofon Spafaridis", - "email": "nohponex@gmail.com", - "homepage": "https://nohponex.gr" + "name": "Xenofon Spafaridis", + "email": "nohponex@gmail.com", + "homepage": "https://nohponex.gr" }, { "name": "Alex Kalliontzis", @@ -26,27 +26,28 @@ } }, "require": { - "php": "^7.1 || ^8.0.0", + "php": "^8.2", "ext-json": "*", "phramework/exceptions": "0.*" }, "require-dev": { - "phpunit/phpunit": "^8.0", - "squizlabs/php_codesniffer": "^3.2.3", - "php-coveralls/php-coveralls": "^2.0.0", - "codacy/coverage": "^1.0" + "phpunit/phpunit": "^12", + "squizlabs/php_codesniffer": "^3", + "php-coveralls/php-coveralls": "^2" }, "minimum-stability": "dev", "prefer-stable": true, "archive": { - "exclude": ["tests"] + "exclude": [ + "tests" + ] }, "scripts": { "test": [ "find src/ -name '*.php' -print0 | xargs -0 -L 1 php -l", "find tests/ -name '*.php' -print0 | xargs -0 -L 1 php -l", - "phpunit; start=\"file://\";end=\"build/coverage/index.html\"; echo \"\nOpen $start$(pwd)/$end\" in browser..." + "phpunit --configuration phpunit.xml --coverage-text" ], "lint": "phpcs -p -s --standard=PSR2 ./src" } -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..4c5315d --- /dev/null +++ b/composer.lock @@ -0,0 +1,3752 @@ +{ + "_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": "9adc4f08872347415145ae3c0fbaebcc", + "packages": [ + { + "name": "phramework/exceptions", + "version": "0.2.0", + "source": { + "type": "git", + "url": "https://github.com/phramework/exceptions.git", + "reference": "be214fe78997d9074addfce1d07f5e8b768114b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phramework/exceptions/zipball/be214fe78997d9074addfce1d07f5e8b768114b0", + "reference": "be214fe78997d9074addfce1d07f5e8b768114b0", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "apigen/apigen": "^4.1", + "phpunit/phpunit": "5.*", + "squizlabs/php_codesniffer": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Phramework\\Exceptions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Xenofon Spafaridis", + "email": "nohponex@gmail.com", + "homepage": "https://nohponex.gr" + } + ], + "description": "phramework exceptions", + "homepage": "https://phramework.github.io/", + "support": { + "issues": "https://github.com/phramework/exceptions/issues", + "source": "https://github.com/phramework/exceptions/tree/master" + }, + "time": "2018-06-12T10:26:58+00:00" + } + ], + "packages-dev": [ + { + "name": "codacy/coverage", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/codacy/php-codacy-coverage.git", + "reference": "1852ca987c91ef466ebcfdbdd4e1788b653eaf1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/codacy/php-codacy-coverage/zipball/1852ca987c91ef466ebcfdbdd4e1788b653eaf1d", + "reference": "1852ca987c91ef466ebcfdbdd4e1788b653eaf1d", + "shasum": "" + }, + "require": { + "gitonomy/gitlib": ">=1.0", + "php": ">=5.3.3", + "symfony/console": "~2.5|~3.0|~4.0|~5.0" + }, + "require-dev": { + "clue/phar-composer": "^1.1", + "phpunit/phpunit": "~6.5" + }, + "bin": [ + "bin/codacycoverage" + ], + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakob Pupke", + "email": "jakob.pupke@gmail.com" + } + ], + "description": "Sends PHP test coverage information to Codacy.", + "homepage": "https://github.com/codacy/php-codacy-coverage", + "support": { + "issues": "https://github.com/codacy/php-codacy-coverage/issues", + "source": "https://github.com/codacy/php-codacy-coverage/tree/master" + }, + "abandoned": true, + "time": "2020-01-10T10:52:12+00:00" + }, + { + "name": "gitonomy/gitlib", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/gitonomy/gitlib.git", + "reference": "ac17834888bf399a4ecae5e108be52c8c5f93958" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/ac17834888bf399a4ecae5e108be52c8c5f93958", + "reference": "ac17834888bf399a4ecae5e108be52c8c5f93958", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": "^8.0", + "symfony/polyfill-mbstring": "^1.7", + "symfony/process": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "ext-fileinfo": "*", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.20 || ^9.5.9", + "psr/log": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Gitonomy\\Git\\": "src/Gitonomy/Git/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Julien Didier", + "email": "genzo.wm@gmail.com", + "homepage": "https://github.com/juliendidier" + }, + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info", + "homepage": "https://github.com/lyrixx" + }, + { + "name": "Alexandre Salomé", + "email": "alexandre.salome@gmail.com", + "homepage": "https://github.com/alexandresalome" + } + ], + "description": "Library for accessing git", + "support": { + "issues": "https://github.com/gitonomy/gitlib/issues", + "source": "https://github.com/gitonomy/gitlib/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/gitonomy/gitlib", + "type": "tidelift" + } + ], + "time": "2024-11-03T15:59:21+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.9.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.9.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-03-27T13:37:11+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-03-27T13:27:01+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2025-03-27T12:30:47+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.13.3", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-07-05T12:25:42+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.6.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "221b0d0fdf1369c71047ad1d18bb5880017bbc56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/221b0d0fdf1369c71047ad1d18bb5880017bbc56", + "reference": "221b0d0fdf1369c71047ad1d18bb5880017bbc56", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-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/v5.6.0" + }, + "time": "2025-07-27T20:03:57+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "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.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v2.8.0", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "00b9fce4d785a98760ca02f305c197f5fcfb6004" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/00b9fce4d785a98760ca02f305c197f5fcfb6004", + "reference": "00b9fce4d785a98760ca02f305c197f5fcfb6004", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.0 || ^7.0", + "php": "^7.0 || ^8.0", + "psr/log": "^1.0 || ^2.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "require-dev": { + "phpspec/prophecy-phpunit": "^1.1 || ^2.3", + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || >=8.0 <8.5.29 || >=9.0 <9.5.23", + "sanmai/phpunit-legacy-adapter": "^6.1 || ^8.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/php-coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "PhpCoveralls\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp", + "role": "Original creator" + }, + { + "name": "Takashi Matsuo", + "email": "tmatsuo@google.com" + }, + { + "name": "Google Inc" + }, + { + "name": "Dariusz Ruminski", + "email": "dariusz.ruminski@gmail.com", + "homepage": "https://github.com/keradus" + }, + { + "name": "Contributors", + "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "support": { + "issues": "https://github.com/php-coveralls/php-coveralls/issues", + "source": "https://github.com/php-coveralls/php-coveralls/tree/v2.8.0" + }, + "time": "2025-05-12T08:35:27+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "12.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "086553c5b2e0e1e20293d782d788ab768202b621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/086553c5b2e0e1e20293d782d788ab768202b621", + "reference": "086553c5b2e0e1e20293d782d788ab768202b621", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^5.4.0", + "php": ">=8.3", + "phpunit/php-file-iterator": "^6.0", + "phpunit/php-text-template": "^5.0", + "sebastian/complexity": "^5.0", + "sebastian/environment": "^8.0", + "sebastian/lines-of-code": "^4.0", + "sebastian/version": "^6.0", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "12.3.x-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", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.3.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" + } + ], + "time": "2025-07-29T06:19:24+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "961bc913d42fe24a257bfff826a5068079ac7782" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/961bc913d42fe24a257bfff826a5068079ac7782", + "reference": "961bc913d42fe24a257bfff826a5068079ac7782", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.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", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:58:37+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^12.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.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": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:58:58+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53", + "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:59:16+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "8.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "8.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", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:59:38+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "12.2.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "8b1348b254e5959acaf1539c6bd790515fb49414" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8b1348b254e5959acaf1539c6bd790515fb49414", + "reference": "8b1348b254e5959acaf1539c6bd790515fb49414", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.3", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.3", + "phpunit/php-code-coverage": "^12.3.1", + "phpunit/php-file-iterator": "^6.0.0", + "phpunit/php-invoker": "^6.0.0", + "phpunit/php-text-template": "^5.0.0", + "phpunit/php-timer": "^8.0.0", + "sebastian/cli-parser": "^4.0.0", + "sebastian/comparator": "^7.1.0", + "sebastian/diff": "^7.0.0", + "sebastian/environment": "^8.0.2", + "sebastian/exporter": "^7.0.0", + "sebastian/global-state": "^8.0.0", + "sebastian/object-enumerator": "^7.0.0", + "sebastian/type": "^6.0.2", + "sebastian/version": "^6.0.0", + "staabm/side-effects-detector": "^1.0.5" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "12.2-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.2.7" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2025-07-11T04:11:13+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/2.0.0" + }, + "time": "2021-07-14T16:41:46+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/6d584c727d9114bcdc14c86711cd1cad51778e7c", + "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.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", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:53:50+00:00" + }, + { + "name": "sebastian/comparator", + "version": "7.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "03d905327dccc0851c9a08d6a979dfc683826b6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/03d905327dccc0851c9a08d6a979dfc683826b6f", + "reference": "03d905327dccc0851c9a08d6a979dfc683826b6f", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.3", + "sebastian/diff": "^7.0", + "sebastian/exporter": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^12.2" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.1-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", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/7.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2025-06-17T07:41:58+00:00" + }, + { + "name": "sebastian/complexity", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb", + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:55:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "7.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0", + "symfony/process": "^7.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.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", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:55:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "8.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "d364b9e5d0d3b18a2573351a1786fbf96b7e0792" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d364b9e5d0d3b18a2573351a1786fbf96b7e0792", + "reference": "d364b9e5d0d3b18a2573351a1786fbf96b7e0792", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "8.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 functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/8.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" + } + ], + "time": "2025-05-21T15:05:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "7.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "76432aafc58d50691a00d86d0632f1217a47b688" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/76432aafc58d50691a00d86d0632f1217a47b688", + "reference": "76432aafc58d50691a00d86d0632f1217a47b688", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.3", + "sebastian/recursion-context": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.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", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:56:42+00:00" + }, + { + "name": "sebastian/global-state", + "version": "8.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "570a2aeb26d40f057af686d63c4e99b075fb6cbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/570a2aeb26d40f057af686d63c4e99b075fb6cbc", + "reference": "570a2aeb26d40f057af686d63c4e99b075fb6cbc", + "shasum": "" + }, + "require": { + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "8.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": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/8.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:56:59+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f", + "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.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", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:57:28+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "7.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "shasum": "" + }, + "require": { + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.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", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:57:48+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "4bfa827c969c98be1e527abd576533293c634f6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a", + "reference": "4bfa827c969c98be1e527abd576533293c634f6a", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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": "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", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:58:17+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "7.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "c405ae3a63e01b32eb71577f8ec1604e39858a7c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c405ae3a63e01b32eb71577f8ec1604e39858a7c", + "reference": "c405ae3a63e01b32eb71577f8ec1604e39858a7c", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T05:00:01+00:00" + }, + { + "name": "sebastian/type", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "1d7cd6e514384c36d7a390347f57c385d4be6069" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/1d7cd6e514384c36d7a390347f57c385d4be6069", + "reference": "1d7cd6e514384c36d7a390347f57c385d4be6069", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.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 types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-03-18T13:37:31+00:00" + }, + { + "name": "sebastian/version", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c", + "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c", + "shasum": "" + }, + "require": { + "php": ">=8.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.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", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T05:00:38+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.13.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "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": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-06-17T22:17:01+00:00" + }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" + }, + { + "name": "symfony/config", + "version": "v7.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "ba62ae565f1327c2f6366726312ed828c85853bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/ba62ae565f1327c2f6366726312ed828c85853bc", + "reference": "ba62ae565f1327c2f6366726312ed828c85853bc", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/filesystem": "^7.1", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "require-dev": { + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v7.3.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": "2025-05-15T09:04:05+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.47" + }, + "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": "2024-11-06T11:30:55+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.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": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.3.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": "2024-10-25T15:15:23+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "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.32.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": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.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": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.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": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.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": "2024-12-23T08:48:59+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.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": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.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": "2025-01-02T08:10:11+00:00" + }, + { + "name": "symfony/process", + "version": "v7.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", + "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.3.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": "2025-04-17T09:11:12+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.6.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": "2025-04-25T09:37:31+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", + "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.3.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": "2025-02-24T10:49:57+00:00" + }, + { + "name": "symfony/string", + "version": "v6.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "73e2c6966a5aef1d4892873ed5322245295370c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/73e2c6966a5aef1d4892873ed5322245295370c6", + "reference": "73e2c6966a5aef1d4892873ed5322245295370c6", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.4.21" + }, + "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": "2025-04-18T15:23:29+00:00" + }, + { + "name": "symfony/yaml", + "version": "v6.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "93e29e0deb5f1b2e360adfb389a20d25eb81a27b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/93e29e0deb5f1b2e360adfb389a20d25eb81a27b", + "reference": "93e29e0deb5f1b2e360adfb389a20d25eb81a27b", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.4" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0|^7.0" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v6.4.23" + }, + "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": "2025-06-03T06:46:12+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "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.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": {}, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^7.1 || ^8.0", + "ext-json": "*" + }, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +} diff --git a/phpunit.xml b/phpunit.xml index 1ad5dcf..7c4811c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,31 +2,37 @@ + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" + displayDetailsOnPhpunitDeprecations="true" +> + + + ./src + + + + + + ./tests/src/ + ../tests/_fixture + + - - ./tests/src/ - ../tests/_fixture - + + + + + + + - - - - - + + - - - - ./src - - - + \ No newline at end of file diff --git a/src/BaseValidator.php b/src/BaseValidator.php index 0f7ba96..1c8787f 100644 --- a/src/BaseValidator.php +++ b/src/BaseValidator.php @@ -798,7 +798,7 @@ public function toArray() return $object; } - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this->toArray(); } diff --git a/src/DateValidator.php b/src/DateValidator.php index fd16b45..4969db9 100644 --- a/src/DateValidator.php +++ b/src/DateValidator.php @@ -51,8 +51,8 @@ class DateValidator extends \Phramework\Validate\StringValidator * ``` */ public function __construct( - string $formatMinimum = null, - string $formatMaximum = null + string|null $formatMinimum = null, + string|null $formatMaximum = null ) { parent::__construct(); diff --git a/src/DatetimeValidator.php b/src/DatetimeValidator.php index 269d2b6..9f949fa 100644 --- a/src/DatetimeValidator.php +++ b/src/DatetimeValidator.php @@ -51,8 +51,8 @@ class DatetimeValidator extends \Phramework\Validate\StringValidator * ``` */ public function __construct( - string $formatMinimum = null, - string $formatMaximum = null + string|null $formatMinimum = null, + string|null $formatMaximum = null ) { parent::__construct(); diff --git a/src/Formats/StringFormatValidatorValidator.php b/src/Formats/StringFormatValidatorValidator.php index ef50ad3..0094c02 100644 --- a/src/Formats/StringFormatValidatorValidator.php +++ b/src/Formats/StringFormatValidatorValidator.php @@ -19,7 +19,7 @@ class StringFormatValidatorValidator implements IFormatValidator public function validateFormat( string $data, string $format, - \stdClass $formatProperties = null + \stdClass|null $formatProperties = null ): ValidateResult { $validateResult = new ValidateResult( $data, diff --git a/src/IFormatValidator.php b/src/IFormatValidator.php index 9ddac6e..8b3bd31 100644 --- a/src/IFormatValidator.php +++ b/src/IFormatValidator.php @@ -13,6 +13,6 @@ interface IFormatValidator public function validateFormat( string $data, string $format, - \stdClass $formatProperties = null + \stdClass|null $formatProperties = null ): ValidateResult; } diff --git a/src/StringValidator.php b/src/StringValidator.php index 3fd6d20..6950d15 100644 --- a/src/StringValidator.php +++ b/src/StringValidator.php @@ -189,9 +189,7 @@ public function validate($value) $return->value = $value; } else { //or filter - $return->value = strip_tags( - filter_var($value, FILTER_SANITIZE_STRING) - ); + $return->value = htmlspecialchars(strip_tags($value), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); } } diff --git a/src/ValidateResult.php b/src/ValidateResult.php index 5cdbf70..a15501b 100644 --- a/src/ValidateResult.php +++ b/src/ValidateResult.php @@ -51,7 +51,7 @@ public function __construct($value, $status = false, $errorObject = null) $this->errorObject = $errorObject; } - public function jsonSerialize() + public function jsonSerialize(): mixed { return get_object_vars($this); } diff --git a/tests/src/AllOfTest.php b/tests/src/AllOfTest.php index abddb37..4db4e47 100644 --- a/tests/src/AllOfTest.php +++ b/tests/src/AllOfTest.php @@ -2,6 +2,8 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\TestCase; class AllOfTest extends TestCase @@ -29,14 +31,12 @@ protected function setUp(): void * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ - protected function tearDown(): void - { - } + protected function tearDown(): void {} - public function validateSuccessProvider() + public static function validateSuccessProvider() { //input, expected - return [ + return [ [1, 1], [10, 10], [100, 100], @@ -44,7 +44,7 @@ public function validateSuccessProvider() ]; } - public function validateFailureProvider() + public static function validateFailureProvider() { //input return [ @@ -73,46 +73,33 @@ public function testConstruct() new StringValidator() ) ]); + $this->assertInstanceOf(AllOf::class, $validator); } - /** - * @expectedException \Exception - */ public function testConstructFailure() { + $this->expectException(\Exception::class); $validator = new AllOf(['{"type": "integer"}']); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(int $input, int $expected): void { $return = $this->object->validate($input); $this->assertTrue($return->status); - if (is_array($return->value)) { - $this->assertInternalType('array', $return->value); - - foreach ($return->value as $values) { - $this->assertInternalType('integer', $values); - } - } else { - $this->assertInternalType('integer', $return->value); - } + $this->assertIsInt($return->value); - $this->assertEquals($expected, $return->value); + $this->assertSame($expected, $return->value); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input = null) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure($input = null): void { $return = $this->object->validate($input); - $this->assertSame(false, $return->status); + $this->assertFalse($return->status); } public function testCreateFromJSON() @@ -135,7 +122,7 @@ public function testCreateFromJSON() //Set validator $this->object = $validator; - $this->assertInternalType('array', $validator->allOf); + $this->assertIsArray($validator->allOf); $this->testValidateSuccess(10, 10); $this->testValidateSuccess(-1, -1); @@ -147,52 +134,46 @@ public function testCreateFromJSON() return $validator; } - /** - * @depends testCreateFromJSON - */ + #[Depends('testCreateFromJSON')] public function testToObject($validator) { $object = $validator->toObject(); - $this->assertObjectHasAttribute('allOf', $object); - $this->assertInternalType('array', $object->allOf); + $this->assertObjectHasProperty('allOf', $object); + $this->assertIsArray($object->allOf); - $this->assertInternalType('object', $object->allOf[0]); - $this->assertInternalType('object', $object->allOf[1]); + $this->assertIsObject($object->allOf[0]); + $this->assertIsObject($object->allOf[1]); } - /** - * @depends testCreateFromJSON - */ + #[Depends('testCreateFromJSON')] public function testToArray($validator) { $object = $validator->toArray(); $this->assertArrayHasKey('allOf', $object); - $this->assertInternalType('array', $object['allOf']); + $this->assertIsArray($object['allOf']); - $this->assertInternalType('array', $object['allOf'][0]); - $this->assertInternalType('array', $object['allOf'][1]); + $this->assertIsArray($object['allOf'][0]); + $this->assertIsArray($object['allOf'][1]); } - /** - * @depends testCreateFromJSON - */ + #[Depends('testCreateFromJSON')] public function testToJSON($validator) { $json = $validator->toJSON(); - $this->assertInternalType('string', $json); + $this->assertIsString($json); $object = json_decode($json); - $this->assertObjectHasAttribute('allOf', $object); + $this->assertObjectHasProperty('allOf', $object); } /** * Validate against common enum keyword */ - public function testValidateCommon() + public function testValidateCommon(): void { $validator = $this->object; @@ -217,7 +198,7 @@ public function testValidateCommon() ); } - public function testGetType() + public function testGetType(): void { $this->assertSame(null, $this->object->getType()); } diff --git a/tests/src/AnyOfTest.php b/tests/src/AnyOfTest.php index c19e730..4f87485 100644 --- a/tests/src/AnyOfTest.php +++ b/tests/src/AnyOfTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class AnyOfTest extends TestCase @@ -36,7 +37,7 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider() { //input, expected return [ @@ -48,7 +49,7 @@ public function validateSuccessProvider() ]; } - public function validateFailureProvider() + public static function validateFailureProvider() { //input return [ @@ -66,7 +67,7 @@ public function validateFailureProvider() ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new AnyOf([ new StringValidator(), @@ -76,39 +77,34 @@ public function testConstruct() new StringValidator() ) ]); + $this->assertInstanceOf(AnyOf::class, $validator); } - /** - * @expectedException \Exception - */ - public function testConstructFailure() + public function testConstructFailure(): void { - $validator = new AnyOf(['{"type": "integer"}']); + $this->expectException(\Exception::class); + new AnyOf(['{"type": "integer"}']); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess($input, $expected): void { $return = $this->object->validate($input); $this->assertTrue($return->status); if (is_array($return->value)) { - $this->assertInternalType('array', $return->value); - foreach ($return->value as $values) { - $this->assertInternalType('integer', $values); + $this->assertIsInt($values); } } else { - $this->assertInternalType('integer', $return->value); + $this->assertIsInt($return->value); } $this->assertEquals($expected, $return->value); } - public function testValidateSuccessFailureTypes() + public function testValidateSuccessFailureTypes(): void { //any @@ -150,17 +146,15 @@ public function testValidateSuccessFailureTypes() $this->assertEquals('oneOf', $parameters[0]['failure']); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input = null) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure($input = null): void { $return = $this->object->validate($input); - $this->assertEquals(false, $return->status); + $this->assertFalse($return->status); } - public function testCreateFromObject() + public function testCreateFromObject(): void { $object = (object)json_decode('{ "anyOf": [ @@ -179,10 +173,9 @@ public function testCreateFromObject() $validator = BaseValidator::createFromObject($object); $this->assertInstanceOf(AnyOf::class, $validator); - - $this->assertInternalType('array', $validator->anyOf); + $this->assertIsArray($validator->anyOf); } - public function testCreateFromObjectForAdditional() + public function testCreateFromJSON(): void { $json = '{ "anyOf": [ @@ -201,27 +194,26 @@ public function testCreateFromObjectForAdditional() $validator = BaseValidator::createFromJSON($json); $this->assertInstanceOf(AnyOf::class, $validator); + $this->assertIsArray($validator->anyOf); - $this->assertInternalType('array', $validator->anyOf); - - //Set validator - $this->object = $validator; - - $this->testValidateSuccess(10, 10); - $this->testValidateSuccess([10, 20], [10, 20]); - - $this->testValidateFailure(10.5); - $this->testValidateFailure('null'); + //Test success + $return = $validator->validate(10); + $this->assertTrue($return->status); + $this->assertSame(10, $return->value); - $this->setUp(); + $return = $validator->validate([10, 20]); + $this->assertTrue($return->status); + $this->assertEquals([10, 20], $return->value); - return $validator; + //Test failure + $this->assertFalse($validator->validate(10.5)->status); + $this->assertFalse($validator->validate('null')->status); } /** * Validate against common enum keyword */ - public function testValidateCommon() + public function testValidateCommon(): void { $validator = $this->object; @@ -252,7 +244,7 @@ public function testValidateCommon() ); } - public function testGetType() + public function testGetType(): void { $this->assertSame(null, $this->object->getType()); } diff --git a/tests/src/ArrayValidatorTest.php b/tests/src/ArrayValidatorTest.php index 2ad3a0b..5218144 100644 --- a/tests/src/ArrayValidatorTest.php +++ b/tests/src/ArrayValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ArrayValidatorTest extends TestCase @@ -24,11 +25,9 @@ protected function setUp(): void * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ - protected function tearDown(): void - { - } + protected function tearDown(): void {} - public function testConstruct() + public function testConstruct(): void { $validator = new ArrayValidator( 1, @@ -37,54 +36,47 @@ public function testConstruct() true, false ); + $this->assertInstanceOf(ArrayValidator::class, $validator); } - /** - * @expectedException \Exception - */ - public function testConstructFailure1() + public function testConstructFailure1(): void { - $validator = new ArrayValidator( + $this->expectException(\Exception::class); + new ArrayValidator( 1, 3, [] ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure2() + public function testConstructFailure2(): void { - $validator = new ArrayValidator( + $this->expectException(\Exception::class); + new ArrayValidator( 'a' ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure3() + public function testConstructFailure3(): void { - $validator = new ArrayValidator( + $this->expectException(\Exception::class); + new ArrayValidator( 3, 1 ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure4() + public function testConstructFailure4(): void { - $validator = new ArrayValidator( + $this->expectException(\Exception::class); + new ArrayValidator( 1, 3, new \stdClass() ); } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input return [ @@ -95,31 +87,27 @@ public function validateSuccessProvider() ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - [1], - ['0 items' => []], - ['>3 items' => [1,2,3,4,5,6]] + 'not an array' => [1], + '0 items' => [[]], + '>3 items' => [[1, 2, 3, 4, 5, 6]] ]; } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(array $input): void { $return = $this->object->validate($input); - $this->assertInternalType('array', $return->value); + $this->assertIsArray($return->value); $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); @@ -130,7 +118,7 @@ public function testValidateFailure($input) ); } - public function testValidateUnique() + public function testValidateUnique(): void { $validator = new ArrayValidator( 1, @@ -148,7 +136,7 @@ public function testValidateUnique() $this->assertFalse($return->status); } - public function testValidateUniqueObject() + public function testValidateUniqueObject(): void { $validator = new ArrayValidator( 1, @@ -172,7 +160,7 @@ public function testValidateUniqueObject() $this->assertFalse($return->status); } - public function testValidateItems() + public function testValidateItems(): void { $validator = new ArrayValidator( 1, @@ -199,7 +187,7 @@ public function testValidateItems() $this->assertFalse($return->status); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "array", @@ -247,12 +235,12 @@ public function testCreateFromJSON() $this->assertFalse($return->status); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('array', $this->object->getType()); } - public function testEquals() + public function testEquals(): void { $this->assertTrue( ArrayValidator::equals( @@ -298,28 +286,29 @@ public function testEquals() ); } - public function testSetValidateCallback() + public function testSetValidateCallback(): void { $value = [1, 2]; $validator = (new ArrayValidator()) ->setValidateCallback( - /** - * @param ValidateResult $validateResult - * @param BaseValidator $validator - * @return ValidateResult - */ + /** + * @param ValidateResult $validateResult + * @param BaseValidator $validator + * @return ValidateResult + */ function ($validateResult, $validator) use ($value) { $validateResult->value = $value; return $validateResult; - }); + } + ); $this->assertInstanceOf(ArrayValidator::class, $validator); $parsed = $validator->parse(['a', 'b', 'c']); - $this->assertInternalType('array', $parsed); + $this->assertIsArray($parsed); $this->assertEquals($value, $parsed); } } diff --git a/tests/src/BaseValidatorTest.php b/tests/src/BaseValidatorTest.php index e9a6684..1b625f5 100644 --- a/tests/src/BaseValidatorTest.php +++ b/tests/src/BaseValidatorTest.php @@ -2,7 +2,6 @@ namespace Phramework\Validate; -use Nette\Neon\Exception; use PHPUnit\Framework\TestCase; use Phramework\Exceptions\IncorrectParametersException; @@ -35,11 +34,9 @@ protected function setUp(): void * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ - protected function tearDown(): void - { - } + protected function tearDown(): void {} - public function testParseStatic() + public function testParseStatic(): void { $this->assertSame( 5, @@ -54,12 +51,12 @@ public function testParseStatic() $o = ObjectValidator::parseStatic(['ok' => true]); - $this->assertInternalType('object', $o); - $this->assertObjectHasAttribute('ok', $o); + $this->assertIsObject($o); + $this->assertObjectHasProperty('ok', $o); $this->assertSame(true, $o->ok); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "integer", @@ -77,7 +74,7 @@ public function testCreateFromJSON() ); } - public function testCreateFromJSON2() + public function testCreateFromJSON2(): void { $json = '{ "type": "unsignedinteger", @@ -96,7 +93,7 @@ public function testCreateFromJSON2() ); } - public function testCreateFromJSON3() + public function testCreateFromJSON3(): void { $json = ' { @@ -122,8 +119,7 @@ public function testCreateFromJSON3() $validationObject = ObjectValidator::createFromJSON($json); $this->assertInstanceOf(ObjectValidator::class, $validationObject); - $this->assertInternalType( - 'object', + $this->assertIsObject( $validationObject->properties ); $this->assertInstanceOf( @@ -142,8 +138,7 @@ public function testCreateFromJSON3() UnsignedIntegerValidator::class, $data->properties->order ); - $this->assertInternalType( - 'array', + $this->assertIsArray( $data->properties->type->enum ); @@ -153,7 +148,7 @@ public function testCreateFromJSON3() ); } - public function testCreateFromJSONNot() + public function testCreateFromJSONNot(): void { $json = '{ "type": "integer", @@ -174,25 +169,21 @@ public function testCreateFromJSONNot() $this->assertFalse($return->status); } - /** - * @expectedException \Exception - */ - public function testCreateFromJSONFailure() + public function testCreateFromJSONFailure(): void { + $this->expectException(\Exception::class); $json = '{ "type": "xyz", "minimum" : -1000, "maximum" : 1000 }'; - $validationObject = IntegerValidator::createFromJSON($json); + IntegerValidator::createFromJSON($json); } - /** - * @expectedException \Exception - */ - public function testCreateFromJSONFailure2() + public function testCreateFromJSONFailure2(): void { + $this->expectException(\Exception::class); //Add an unexpected comma at the end of JSON string $json = '{ "type": "interger", @@ -200,12 +191,12 @@ public function testCreateFromJSONFailure2() "maximum" : 1000, }'; - $validationObject = IntegerValidator::createFromJSON($json); + IntegerValidator::createFromJSON($json); } - public function testParseSuccess() + public function testParseSuccess(): void { $validationObject = new ObjectValidator( [ //properties @@ -231,15 +222,15 @@ public function testParseSuccess() ]; $record = $validationObject->parse($input); - $this->assertInternalType('object', $record); - $this->assertInternalType('object', $record->obj); - $this->assertInternalType('float', $record->obj->not_required); + $this->assertIsObject($record); + $this->assertIsObject($record->obj); + $this->assertIsFloat($record->obj->not_required); $this->assertEquals(5, $record->weight); $this->assertTrue($record->obj->valid); $this->assertEquals(5.5, $record->obj->not_required); } - public function testParseSuccess2() + public function testParseSuccess2(): void { $input = '5'; @@ -247,16 +238,13 @@ public function testParseSuccess2() $cleanInput = $validationModel->parse($input); - $this->assertInternalType('integer', $cleanInput); + $this->assertIsInt($cleanInput); $this->assertEquals(5, $cleanInput); } - /** - * @expectedException \Exception - * @todo \Phramework\Exceptions\MissingParametersException - */ - public function testParseFailure() + public function testParseFailure(): void { + $this->expectException(\Exception::class); $input = [ 'weight' => '5', 'obj' => [ @@ -280,15 +268,12 @@ public function testParseFailure() ['weight'] //required ); - $record = $validationObject->parse($input); + $validationObject->parse($input); } - /** - * @expectedException \Exception - * @todo \Phramework\Exceptions\IncorrectParametersException - */ - public function testParseFailure2() + public function testParseFailure2(): void { + $this->expectException(\Exception::class); $input = [ 'weight' => '555', //out of range 'obj' => [ @@ -313,36 +298,35 @@ public function testParseFailure2() ['weight'] //required ); - $record = $validationObject->parse($input); + $validationObject->parse($input); } - public function testConstruct() + public function testConstruct(): void { $validator = new ArrayValidator( 1, 3 ); + $this->assertInstanceOf(ArrayValidator::class, $validator); } - public function testCreateFromObjectTypeless() + public function testCreateFromObjectTypeless(): void { $validator = IntegerValidator::createFromObject((object)[]); $this->assertInstanceOf(IntegerValidator::class, $validator); } - /** - * @expectedException \Exception - */ - public function testCreateFromObjectTypelessFailure() + public function testCreateFromObjectTypelessFailure(): void { - $validator = BaseValidator::createFromObject((object)[]); + $this->expectException(\Exception::class); + BaseValidator::createFromObject((object)[]); } /** * Validate against common enum keyword */ - public function testValidateCommon() + public function testValidateCommon(): void { (new IntegerValidator())->parse(5); @@ -374,7 +358,7 @@ public function testValidateCommon() /** * Validate against common enum keyword */ - public function testValidateEnum() + public function testValidateEnum(): void { $validator = (new IntegerValidator(0, 10)); @@ -405,14 +389,14 @@ public function testValidateEnum() $parsed = $validator->parse('111'); - $this->assertInternalType('integer', $parsed); + $this->assertIsInt($parsed); $this->assertSame(111, $parsed); } /** * Validate against common enum keyword */ - public function testValidateEnumArray() + public function testValidateEnumArray(): void { $validator = (new ArrayValidator()) ->setEnum([[1], [2, 12]]); @@ -420,13 +404,9 @@ public function testValidateEnumArray() $this->assertEquals([2, 12], $validator->parse([12, 2])); } - /** - * Validate against common enum keyword, - * expect exception since objects and arrays are not yet supported for enum keyword - * @expectedException \Exception - */ - public function testValidateEnumException2() + public function testValidateEnumException2(): void { + $this->expectException(\Exception::class); $validator = (new IntegerValidator(0, 10)); $validator->enum = [[1], new \stdClass(), 5]; @@ -434,11 +414,9 @@ public function testValidateEnumException2() $validator->validate(2); } - /** - * @expectedException \Exception - */ - public function testValidateEnumException3() + public function testValidateEnumException3(): void { + $this->expectException(\Exception::class); $validator = (new ObjectValidator()); $validator->enum = new \stdClass(); @@ -449,7 +427,7 @@ public function testValidateEnumException3() /** * Validate against common not keyword */ - public function testValidateNot() + public function testValidateNot(): void { $validator = new StringValidator(); @@ -478,12 +456,9 @@ public function testValidateNot() $this->assertFalse($return->status); } - /** - * Validate against common not keyword - * @expectedException \Exception - */ - public function testValidateNotFailure() + public function testValidateNotFailure(): void { + $this->expectException(\Exception::class); $validator = new IntegerValidator(); $validator->not = new \stdClass(); @@ -491,19 +466,17 @@ public function testValidateNotFailure() $validator->parse(1); } - /** - * @expectedException \Exception - */ - public function testParseFailure3() + public function testParseFailure3(): void { + $this->expectException(\Exception::class); $input = '87'; $validationModel = new IntegerValidator(0, 6); - $cleanInput = $validationModel->parse($input); + $validationModel->parse($input); } - public function testGet() + public function testGet(): void { $validator = new IntegerValidator(); @@ -514,41 +487,37 @@ public function testGet() $this->assertEquals(0, $validator->__get('default')); } - /** - * @expectedException \Exception - */ - public function testGet2() + public function testGet2(): void { + $this->expectException(\Exception::class); $validator = new IntegerValidator(); $validator->IM_SURE_THIS_CANT_BE_FOUND; } - /** - * @expectedException \Exception - */ - public function testSetFailure() + public function testSetFailure(): void { + $this->expectException(\Exception::class); $validator = new IntegerValidator(); $validator->IM_SURE_THIS_CANT_BE_FOUND = 'value'; } - public function testGetType() + public function testGetType(): void { $validator = new IntegerValidator(); $this->assertEquals('integer', $validator->getType()); } - public function testGetTypeAttributes() + public function testGetTypeAttributes(): void { $validator = new IntegerValidator(); - $this->assertInternalType('array', $validator->getTypeAttributes()); + $this->assertIsArray($validator->getTypeAttributes()); foreach ($validator->getTypeAttributes() as $attribute) { - $this->assertInternalType('string', $attribute); + $this->assertIsString($attribute); } } - public function testSetSuccess() + public function testSetSuccess(): void { $validator = new IntegerValidator(); $validator->title = 'my title'; @@ -566,7 +535,7 @@ public function testSetSuccess() ); } - public function testSetTitle() + public function testSetTitle(): void { $validator = new IntegerValidator(); $validator->setTitle('my title'); @@ -576,7 +545,7 @@ public function testSetTitle() ); } - public function testSetDescription() + public function testSetDescription(): void { $validator = new IntegerValidator(); $validator->setDescription('my description'); @@ -586,7 +555,7 @@ public function testSetDescription() ); } - public function testSetDefault() + public function testSetDefault(): void { $validator = new IntegerValidator(); $validator->setDefault(222); @@ -597,24 +566,22 @@ public function testSetDefault() ); } - public function testSetNot() + public function testSetNot(): void { $validator = new IntegerValidator(); $validator->setNot(new EnumValidator([0, 2])); } - /** - * @expectedException \Exception - */ - public function testSetNotFailure() + public function testSetNotFailure(): void { + $this->expectException(\Exception::class); $validator = new IntegerValidator(); $validator->setNot([0, 1]); } - public function testSetEnum() + public function testSetEnum(): void { $validator = new IntegerValidator(); @@ -640,7 +607,7 @@ public function testSetEnum() ); } - public function testCreateFromArray() + public function testCreateFromArray(): void { $schema = [ 'type' => 'integer', @@ -656,18 +623,15 @@ public function testCreateFromArray() $this->assertSame(2, $validator->maximum); } - /** - * @expectedException \Exception - */ - public function testCreateFromObjectForAdditionalFailureNull() + public function testCreateFromObjectForAdditionalFailureNull(): void { - $object = (object)[ - ]; + $this->expectException(\Exception::class); + $object = (object)[]; BaseValidator::createFromObject($object); } - public function testCreateFromObject() + public function testCreateFromObject(): void { $schema = (object)[ 'type' => 'integer', @@ -698,11 +662,9 @@ public function testCreateFromObject() $validator->parse((object)['code' => 10]); } - /** - * @expectedException \Exception - */ - public function testCreateFromObjectFailure() + public function testCreateFromObjectFailure(): void { + $this->expectException(\Exception::class); $object = (object)[ 'type' => 'x-not-found' ]; @@ -710,26 +672,24 @@ public function testCreateFromObjectFailure() $validator = BaseValidator::createFromObject($object); } - /** - * @expectedException \Exception - */ - public function testCreateFromObjectFailureNotObject() + public function testCreateFromObjectFailureNotObject(): void { + $this->expectException(\Exception::class); BaseValidator::createFromObject('string'); } - public function testToObject() + public function testToObject(): void { $return = $this->int->toObject(); - $this->assertInternalType('object', $return); + $this->assertIsObject($return); - $this->assertObjectHasAttribute('type', $return); - $this->assertObjectHasAttribute('minimum', $return); - $this->assertObjectHasAttribute('maximum', $return); + $this->assertObjectHasProperty('type', $return); + $this->assertObjectHasProperty('minimum', $return); + $this->assertObjectHasProperty('maximum', $return); } - public function testToObjec2() + public function testToObjec2(): void { $return = (new ObjectValidator( [ @@ -738,27 +698,27 @@ public function testToObjec2() ['int'] ))->toObject(); - $this->assertInternalType('object', $return); + $this->assertIsObject($return); - $this->assertObjectHasAttribute('type', $return); - $this->assertObjectHasAttribute('properties', $return); - $this->assertObjectHasAttribute('required', $return); + $this->assertObjectHasProperty('type', $return); + $this->assertObjectHasProperty('properties', $return); + $this->assertObjectHasProperty('required', $return); - $this->assertInternalType('object', $return->properties); + $this->assertIsObject($return->properties); } - public function testToArray() + public function testToArray(): void { $return = $this->int->toArray(); - $this->assertInternalType('array', $return); + $this->assertIsArray($return); $this->assertArrayHasKey('type', $return); $this->assertArrayHasKey('minimum', $return); $this->assertArrayHasKey('maximum', $return); } - public function testToArray2() + public function testToArray2(): void { $return = (new ObjectValidator( [ @@ -769,32 +729,32 @@ public function testToArray2() ['int'] ))->toArray(); - $this->assertInternalType('array', $return); + $this->assertIsArray($return); $this->assertArrayHasKey('type', $return); $this->assertArrayHasKey('properties', $return); $this->assertArrayHasKey('required', $return); - $this->assertInternalType('array', $return['properties']); + $this->assertIsArray($return['properties']); } - public function testToJSON() + public function testToJSON(): void { $json = $this->int->toJSON(); - $this->assertInternalType('string', $json); + $this->assertIsString($json); $jsonObject = json_decode($json); //assert no errors $this->assertSame(JSON_ERROR_NONE, json_last_error()); - $this->assertObjectHasAttribute('type', $jsonObject); - $this->assertObjectHasAttribute('minimum', $jsonObject); - $this->assertObjectHasAttribute('maximum', $jsonObject); + $this->assertObjectHasProperty('type', $jsonObject); + $this->assertObjectHasProperty('minimum', $jsonObject); + $this->assertObjectHasProperty('maximum', $jsonObject); } - public function testToJSON2() + public function testToJSON2(): void { $validator = new ObjectValidator( [ @@ -805,19 +765,19 @@ public function testToJSON2() $json = $validator->toJSON(); - $this->assertInternalType('string', $json); + $this->assertIsString($json); $jsonObject = json_decode($json); //assert no errors $this->assertSame(JSON_ERROR_NONE, json_last_error()); - $this->assertObjectHasAttribute('type', $jsonObject); - $this->assertObjectHasAttribute('properties', $jsonObject); + $this->assertObjectHasProperty('type', $jsonObject); + $this->assertObjectHasProperty('properties', $jsonObject); - $this->assertInternalType('object', $jsonObject->properties); + $this->assertIsObject($jsonObject->properties); - $this->assertObjectHasAttribute('int', $jsonObject->properties); + $this->assertObjectHasProperty('int', $jsonObject->properties); $validator = new ArrayValidator( 0, @@ -827,7 +787,7 @@ public function testToJSON2() $json = $validator->toJSON(); - $this->assertInternalType('string', $json); + $this->assertIsString($json); $jsonObject = json_decode($json); @@ -835,7 +795,7 @@ public function testToJSON2() $this->assertSame(JSON_ERROR_NONE, json_last_error()); } - public function testRegisterValidator() + public function testRegisterValidator(): void { BaseValidator::registerValidator( \Phramework\Validate\APP\AddressValidator::getType(), @@ -864,44 +824,38 @@ public function testRegisterValidator() ); } - /** - * @expectedException \Exception - */ - public function testRegisterValidatorFailure() + public function testRegisterValidatorFailure(): void { + $this->expectException(\Exception::class); BaseValidator::registerValidator( \Phramework\Validate\APP\AddressValidator::getType(), \stdClass::class ); } - /** - * @expectedException \Exception - */ - public function testRegisterValidatorFailure2() + public function testRegisterValidatorFailure2(): void { + $this->expectException(\Exception::class); BaseValidator::registerValidator( 5, \Phramework\Validate\APP\AddressValidator::class ); } - /** - * @expectedException \Exception - */ - public function testRegisterValidatorFailure3() + public function testRegisterValidatorFailure3(): void { + $this->expectException(\Exception::class); BaseValidator::registerValidator( \Phramework\Validate\APP\AddressValidator::getType(), 34 ); } - public function testRunValidateCallback() + public function testRunValidateCallback(): void { - (new IntegerValidator())->parse(5); + $this->assertSame(5, (new IntegerValidator())->parse(5)); } - public function testSetValidateCallback() + public function testSetValidateCallback(): void { $value = 5; @@ -915,31 +869,28 @@ public function testSetValidateCallback() function ($validateResult, $validator) { $validateResult->value = $validateResult->value + 1; - return $validateResult; - }); + return $validateResult; + } + ); $this->assertInstanceOf(IntegerValidator::class, $validator); $parsed = $validator->parse($value); - $this->assertInternalType('integer', $parsed); + $this->assertIsInt($parsed); $this->assertSame($value + 1, $parsed); } - /** - * @expectedException \Exception - */ - public function testSetValidateFailure1() + public function testSetValidateFailure1(): void { + $this->expectException(\Exception::class); $validator = (new IntegerValidator()) ->setValidateCallback('pokemon'); } - /** - * @expectedException \Exception - */ - public function testRunValidateCallbackFailure() + public function testRunValidateCallbackFailure(): void { + $this->expectException(\Exception::class); $validator = (new IntegerValidator()) ->setValidateCallback(function ($validateResult, $validator) { $validateResult->status = false; diff --git a/tests/src/BooleanValidatorTest.php b/tests/src/BooleanValidatorTest.php index 72c9301..af8917b 100644 --- a/tests/src/BooleanValidatorTest.php +++ b/tests/src/BooleanValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -32,73 +33,70 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - [1, true], - ['1', true], - [true, true], - ['true', true], - ['TRUE', true], - ['yes', true], - ['on', true], - [0, false], - ['0', false], - [false, false], - ['false', false], - ['FALSE', false], - ['no', false], - ['off', false] + 'integer 1' => [1, true], + 'string 1' => ['1', true], + 'boolean true' => [true, true], + 'string true lowercase' => ['true', true], + 'string true uppercase' => ['TRUE', true], + 'string yes' => ['yes', true], + 'string on' => ['on', true], + 'integer 0' => [0, false], + 'string 0' => ['0', false], + 'boolean false' => [false, false], + 'string false lowercase' => ['false', false], + 'string false uppercase' => ['FALSE', false], + 'string no' => ['no', false], + 'string off' => ['off', false] ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['100'], - ['01'], - [10], - [-1], - [124], - ['τρθε'], - ['positive'], - ['negative'] + 'string 100' => ['100'], + 'string 01' => ['01'], + 'integer 10' => [10], + 'integer -1' => [-1], + 'integer 124' => [124], + 'greek string' => ['τρθε'], + 'string positive' => ['positive'], + 'string negative' => ['negative'] ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new BooleanValidator(); + $this->assertInstanceOf(BooleanValidator::class, $validator); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess($input, bool $expected): void { $return = $this->object->validate($input); - $this->assertInternalType('boolean', $return->value); - $this->assertEquals($expected, $return->value); + $this->assertIsBool($return->value); + $this->assertSame($expected, $return->value); $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure($input): void { $return = $this->object->validate($input); - $this->assertEquals(false, $return->status); + $this->assertFalse($return->status); } /** * Validate against common enum keyword */ - public function testValidateCommon() + public function testValidateCommon(): void { $validator = (new BooleanValidator()); @@ -117,7 +115,7 @@ public function testValidateCommon() ); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('boolean', $this->object->getType()); } diff --git a/tests/src/DateValidatorTest.php b/tests/src/DateValidatorTest.php index 1ee12b7..29eaec3 100644 --- a/tests/src/DateValidatorTest.php +++ b/tests/src/DateValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class DateValidatorTest extends TestCase @@ -29,36 +30,35 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - ['2000-10-12'], - ['2000-01-02'] + 'valid date 1' => ['2000-10-12'], + 'valid date 2' => ['2000-01-02'] ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['10-10-2014'], - ['20'], - ['10-13-2014'], - ['2014-13-10'], - ['2014-01-33'], + 'wrong format d-m-Y' => ['10-10-2014'], + 'just a number' => ['20'], + 'invalid month' => ['10-13-2014'], + 'invalid month Y-m-d' => ['2014-13-10'], + 'invalid day' => ['2014-01-33'], ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new DateValidator(); + $this->assertInstanceOf(DateValidator::class, $validator); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string $input): void { $return = $this->object->validate($input); @@ -66,30 +66,27 @@ public function testValidateSuccess($input) $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(string $input): void { $return = $this->object->validate($input); - $this->assertEquals(false, $return->status); + $this->assertFalse($return->status); } - public function testFormatMinimumSuccess() + public function testFormatMinimumSuccess(): void { $validator = new DateValidator( '2000-10-10' ); - $validator->parse('2000-10-11'); + $this->assertSame('2000-10-11', $validator->parse('2000-10-11')); } - /** - * @expectedException \Exception - */ - public function testFormatMinimumFailure() + public function testFormatMinimumFailure(): void { + $this->expectException(\Exception::class); + $validator = new DateValidator( '2000-10-12' ); @@ -97,21 +94,19 @@ public function testFormatMinimumFailure() $validator->parse('2000-10-11'); } - public function testFormatMinimumMaximumSuccess() + public function testFormatMinimumMaximumSuccess(): void { $validator = new DateValidator( '2000-10-10', '2000-10-12' ); - $validator->parse('2000-10-11'); + $this->assertSame('2000-10-11', $validator->parse('2000-10-11')); } - /** - * @expectedException \Exception - */ - public function testFormatMaximumFailure() + public function testFormatMaximumFailure(): void { + $this->expectException(\Exception::class); $validator = new DateValidator( null, '2000-10-10' @@ -120,7 +115,7 @@ public function testFormatMaximumFailure() $validator->parse('2000-10-12'); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "date" @@ -131,7 +126,7 @@ public function testCreateFromJSON() $this->assertInstanceOf(DateValidator::class, $validationObject); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('date', $this->object->getType()); } diff --git a/tests/src/DatetimeValidatorTest.php b/tests/src/DatetimeValidatorTest.php index 63eede8..eab624a 100644 --- a/tests/src/DatetimeValidatorTest.php +++ b/tests/src/DatetimeValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class DatetimeValidatorTest extends TestCase @@ -21,37 +22,41 @@ protected function setUp(): void $this->object = new DatetimeValidator(); } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - ['2000-10-12 12:00:00'], - ['2000-10-12 12:56:00'] + 'valid datetime 1' => ['2000-10-12 12:00:00'], + 'valid datetime 2' => ['2000-10-12 12:56:00'] ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['10-10-2014'], - ['20'], - ['10-13-2014'], - ['2014-13-10'], - ['2014-13-33'], - ['2000-10-12 12:60:00'], - ['2000-10-12 12:56:60'], - ['2000-10-12 25:56:00'], - ['2000-10-12 23:56'], - ['2000-10-12'], - ['2000-10-12 23'] + 'wrong format d-m-Y' => ['10-10-2014'], + 'just a number' => ['20'], + 'invalid month' => ['10-13-2014'], + 'invalid month Y-m-d' => ['2014-13-10'], + 'invalid day' => ['2014-13-33'], + 'invalid minute' => ['2000-10-12 12:60:00'], + 'invalid second' => ['2000-10-12 12:56:60'], + 'invalid hour' => ['2000-10-12 25:56:00'], + 'missing seconds' => ['2000-10-12 23:56'], + 'date only' => ['2000-10-12'], + 'missing minutes and seconds' => ['2000-10-12 23'] ]; } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input) + public function testConstruct(): void + { + $validator = new DatetimeValidator(); + $this->assertInstanceOf(DatetimeValidator::class, $validator); + } + + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string $input): void { $return = $this->object->validate($input); @@ -59,20 +64,21 @@ public function testValidateSuccess($input) $this->assertTrue($return->status); } - public function testFormatMinimumSuccess() + public function testFormatMinimumSuccess(): void { $validator = new DatetimeValidator( '2000-10-12 12:00:00' ); - $validator->parse('2000-10-12 12:00:01'); + $this->assertSame( + '2000-10-12 12:00:01', + $validator->parse('2000-10-12 12:00:01') + ); } - /** - * @expectedException \Exception - */ - public function testFormatMinimumFailure() + public function testFormatMinimumFailure(): void { + $this->expectException(\Exception::class); $validator = new DatetimeValidator( '2000-10-12 12:00:00' ); @@ -80,21 +86,22 @@ public function testFormatMinimumFailure() $validator->parse('2000-10-11 12:00:00'); } - public function testFormatMinimumMaximumSuccess() + public function testFormatMinimumMaximumSuccess(): void { $validator = new DatetimeValidator( '2000-10-12 12:00:00', '2000-10-12 12:01:00' ); - $validator->parse('2000-10-12 12:00:01'); + $this->assertSame( + '2000-10-12 12:00:01', + $validator->parse('2000-10-12 12:00:01') + ); } - /** - * @expectedException \Exception - */ - public function testFormatMaximumFailure() + public function testFormatMaximumFailure(): void { + $this->expectException(\Exception::class); // Changed $validator = new DatetimeValidator( null, '2000-10-12 12:00:00' @@ -103,18 +110,15 @@ public function testFormatMaximumFailure() $validator->parse('2000-11-12 12:00:00'); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(string $input): void { $return = $this->object->validate($input); - $this->assertEquals(false, $return->status); + $this->assertFalse($return->status); } - - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "date-time" @@ -125,7 +129,7 @@ public function testCreateFromJSON() $this->assertInstanceOf(DatetimeValidator::class, $validationObject); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('date-time', $this->object->getType()); } diff --git a/tests/src/EmailValidatorTest.php b/tests/src/EmailValidatorTest.php index 9d5964a..45139eb 100644 --- a/tests/src/EmailValidatorTest.php +++ b/tests/src/EmailValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -32,56 +33,53 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - ['nohponex@gmail.com'], - ['nohponex_under@gmail.com'], - ['nohponex@mail.co.uk'] + 'gmail' => ['nohponex@gmail.com'], + 'underscore' => ['nohponex_under@gmail.com'], + 'co.uk' => ['nohponex@mail.co.uk'], ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['string' => '100'], - ['less than 10 characters' => 'nx@ma.il'], - ['dotless' => 'nohponex@gmailcom'], - ['longer' => 'nohponex_long_long_long_long_long@gmail.com'], - ['without@' => 'dasdjs#sdads.fd'], - ['number' => 124], + 'string' => ['100'], + 'less than 10 characters' => ['nx@ma.il'], + 'dotless' => ['nohponex@gmailcom'], + 'longer' => ['nohponex_long_long_long_long_long@gmail.com'], + 'without@' => ['dasdjs#sdads.fd'], + 'number' => [124], ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new EmailValidator(); + $this->assertInstanceOf(EmailValidator::class, $validator); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string $input): void { $return = $this->object->validate($input); - $this->assertInternalType('string', $return->value); + $this->assertIsString($return->value); $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); $this->assertFalse($return->status); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "email" @@ -92,7 +90,7 @@ public function testCreateFromJSON() $this->assertInstanceOf(EmailValidator::class, $validationObject); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('email', $this->object->getType()); } diff --git a/tests/src/EnumValidatorTest.php b/tests/src/EnumValidatorTest.php index 8d015cf..2db5f83 100644 --- a/tests/src/EnumValidatorTest.php +++ b/tests/src/EnumValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -32,43 +33,42 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - ['1', '1'], - ['2', '2'], - ['ok', 'ok'], - [5, 5], - [[1,2,3], [1, 2, 3]] + 'string 1' => ['1', '1'], + 'string 2' => ['2', '2'], + 'string ok' => ['ok', 'ok'], + 'integer 5' => [5, 5], + 'array' => [[1, 2, 3], [1, 2, 3]], ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - [1], - [2], - ['5'], - [4], - ['7'], - ['string'] + 'integer 1 (wrong type)' => [1], + 'integer 2 (wrong type)' => [2], + 'string 5 (wrong type)' => ['5'], + 'not in enum 4' => [4], + 'not in enum 7' => ['7'], + 'not in enum string' => ['string'] ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new EnumValidator( ['1', '2', 'ok', 5], true ); + $this->assertInstanceOf(EnumValidator::class, $validator); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(mixed $input, mixed $expected): void { $return = $this->object->validate($input); @@ -76,17 +76,15 @@ public function testValidateSuccess($input, $expected) $this->assertSame($expected, $return->value); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); $this->assertFalse($return->status); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "enum", @@ -98,7 +96,7 @@ public function testCreateFromJSON() $this->assertInstanceOf(EnumValidator::class, $validationObject); } - public function testCreateFromJSONAndValidate() + public function testCreateFromJSONAndValidate(): void { $json = '{ "type": "enum", @@ -110,15 +108,13 @@ public function testCreateFromJSONAndValidate() $this->assertInstanceOf(EnumValidator::class, $validationObject); - $validationObject->parse('1'); - $validationObject->parse(1); + $this->assertSame(1, $validationObject->parse('1')); + $this->assertSame(1, $validationObject->parse(1)); } - /** - * @expectedException \Phramework\Exceptions\IncorrectParametersException - */ - public function testCreateFromJSONAndValidateType() + public function testCreateFromJSONAndValidateType(): void { + $this->expectException(\Phramework\Exceptions\IncorrectParametersException::class); $json = '{ "type": "enum", "enum": [1, 2, 3], @@ -130,7 +126,7 @@ public function testCreateFromJSONAndValidateType() $validationObject->parse('1'); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('enum', $this->object->getType()); } diff --git a/tests/src/IntegerValidatorTest.php b/tests/src/IntegerValidatorTest.php index a0f1c92..9dcd8f9 100644 --- a/tests/src/IntegerValidatorTest.php +++ b/tests/src/IntegerValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -28,74 +29,67 @@ protected function setUp(): void * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ - protected function tearDown(): void - { - } + protected function tearDown(): void {} - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - ['100', 100], - [124, 124], - [0, 0], - [-10, -10], - [-99, -99] + 'string "100"' => ['100', 100], + 'integer 124' => [124, 124], + 'integer 0' => [0, 0], + 'integer -10' => [-10, -10], + 'integer -99' => [-99, -99] ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['-0x'], - ['abc'], - ['+xyz'], - ['++30'], - [-1000], //should fail becaus of exclusiveMinimum - [-10000000], - [10000000], - ['-1000000000'], - [1.4], - [-13.5] + 'hex string' => ['-0x'], + 'alpha string' => ['abc'], + 'plus string' => ['+xyz'], + 'double plus string' => ['++30'], + 'exclusive minimum' => [-1000], //should fail because of exclusiveMinimum + 'out of bounds minimum' => [-10000000], + 'out of bounds maximum' => [10000000], + 'out of bounds string' => ['-1000000000'], + 'float value' => [1.4], + 'negative float value' => [-13.5] ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new IntegerValidator( 0, 1 ); + $this->assertInstanceOf(IntegerValidator::class, $validator); } - /** - * @expectedException \Exception - */ - public function testConstructFailure() + public function testConstructFailure(): void { - $validator = new IntegerValidator( + $this->expectException(\Exception::class); + new IntegerValidator( 'a' ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure2() + public function testConstructFailure2(): void { - $validator = new IntegerValidator( + $this->expectException(\Exception::class); + new IntegerValidator( 1, 'a' ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure3() + public function testConstructFailure3(): void { - $validator = new IntegerValidator( + $this->expectException(\Exception::class); + new IntegerValidator( 1, 2, null, @@ -104,10 +98,8 @@ public function testConstructFailure3() ); } - /** - * @dataProvider validateSuccessProvider - */ - public function testCreateFromJSON($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testCreateFromJSON(string|int $input, int $expected): void { $json = '{ "type": "integer", @@ -132,7 +124,7 @@ public function testCreateFromJSON($input, $expected) 'Default must be passed' ); - $this->assertObjectNotHasAttribute( + $this->assertObjectNotHasProperty( 'x-extra', $validatorObject, 'Attribute must not exists' @@ -145,38 +137,30 @@ public function testCreateFromJSON($input, $expected) /** * Helper method */ - private function validateSuccess(IntegerValidator $object, $input, $expected) + private function validateSuccess(IntegerValidator $object, string|int $input, int $expected): void { $return = $object->validate($input); $this->assertTrue($return->status); - $this->assertInternalType('integer', $return->value); + $this->assertIsInt($return->value); $this->assertSame($expected, $return->value); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string|int $input, int $expected): void { $this->validateSuccess($this->object, $input, $expected); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); $this->assertFalse($return->status); - - $this->markTestIncomplete( - 'Test Exclusive' - ); } - public function testValidateFailureMultipleOf() + public function testValidateFailureMultipleOf(): void { $validator = new IntegerValidator(null, null, null, null, 2); $return = $validator->validate(5); @@ -191,7 +175,7 @@ public function testValidateFailureMultipleOf() /** * Validate against common enum keyword */ - public function testValidateCommon() + public function testValidateCommon(): void { $validator = (new IntegerValidator(0, 10)); @@ -210,7 +194,7 @@ public function testValidateCommon() ); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('integer', $this->object->getType()); } diff --git a/tests/src/NumberValidatorTest.php b/tests/src/NumberValidatorTest.php index 6ac3a1e..0123914 100644 --- a/tests/src/NumberValidatorTest.php +++ b/tests/src/NumberValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -28,90 +29,80 @@ protected function setUp(): void * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ - protected function tearDown(): void - { - } + protected function tearDown(): void {} - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected (float) return [ - ['100', 100.0], - [124, 124.0], - [0, 0.0], - [-10, -10.0], - [-99, -99.0], - [3.5, 3.5], - ['13.5', 13.5], - ['-23.6', -23.6] + 'string 100' => ['100', 100.0], + 'integer 124' => [124, 124.0], + 'integer 0' => [0, 0.0], + 'integer -10' => [-10, -10.0], + 'integer -99' => [-99, -99.0], + 'float 3.5' => [3.5, 3.5], + 'string "13.5"' => ['13.5', 13.5], + 'string "-23.6"' => ['-23.6', -23.6] ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['a'], - ['abc'], - ['-0x'], - ['abc'], - ['+xyz'], - ['++30'], - [-1000], //should fail becaus of exclusiveMinimum - [-10000000], - [10000000], - ['-1000000000'] + 'string a' => ['a'], + 'string abc' => ['abc'], + 'hex string' => ['-0x'], + 'plus string' => ['+xyz'], + 'double plus string' => ['++30'], + 'exclusive minimum' => [-1000], //should fail because of exclusiveMinimum + 'out of bounds minimum' => [-10000000], + 'out of bounds maximum' => [10000000], + 'out of bounds string' => ['-1000000000'] ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new NumberValidator( 0, 1 ); + $this->assertInstanceOf(NumberValidator::class, $validator); } - /** - * @expectedException \Exception - */ - public function testConstructFailure1() + public function testConstructFailure1(): void { - $validator = new NumberValidator( + $this->expectException(\Exception::class); + new NumberValidator( 'a', 1 ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure2() + public function testConstructFailure2(): void { - $validator = new NumberValidator( + $this->expectException(\Exception::class); + new NumberValidator( 1, 'a' ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure3() + public function testConstructFailure3(): void { - $validator = new NumberValidator( + $this->expectException(\Exception::class); + new NumberValidator( 1, 2, 'a' ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure4() + public function testConstructFailure4(): void { - $validator = new NumberValidator( + $this->expectException(\Exception::class); + new NumberValidator( 1, 2, true, @@ -119,12 +110,10 @@ public function testConstructFailure4() ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure5() + public function testConstructFailure5(): void { - $validator = new NumberValidator( + $this->expectException(\Exception::class); + new NumberValidator( 1, 2, true, @@ -133,21 +122,17 @@ public function testConstructFailure5() ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure6() + public function testConstructFailure6(): void { - $validator = new NumberValidator( + $this->expectException(\Exception::class); + new NumberValidator( 2, 1 ); } - /** - * @dataProvider validateSuccessProvider - */ - public function testCreateFromJSON($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testCreateFromJSON(string|int|float $input, float $expected): void { $json = '{ "type": "number", @@ -172,7 +157,7 @@ public function testCreateFromJSON($input, $expected) 'Default must be passed' ); - $this->assertObjectNotHasAttribute( + $this->assertObjectNotHasProperty( 'x-extra', $validatorObject, 'Attribute must not exists' @@ -185,46 +170,36 @@ public function testCreateFromJSON($input, $expected) /** * Helper method */ - private function validateSuccess(NumberValidator $object, $input, $expected) + private function validateSuccess(NumberValidator $object, string|int|float $input, float $expected): void { $return = $object->validate($input); $this->assertTrue($return->status); - $this->assertInternalType('float', $return->value); + $this->assertIsFloat($return->value); $this->assertSame($expected, $return->value); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string|int|float $input, float $expected): void { $this->validateSuccess($this->object, $input, $expected); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateNumberSuccess($input, $expected) - { - $this->validateSuccess($this->object, $input, $expected); - } - - /** - * @dataProvider validateFailureProvider - */ - public function testValidateNumberFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); $this->assertFalse($return->status); } - public function testValidateFailureMultipleOf() + public function testValidateFailureMultipleOf(): void { $validator = new NumberValidator(null, null, null, null, 2); $return = $validator->validate(5); + $this->assertFalse($return->status); + $parameters = $return->errorObject->getParameters(); $this->assertEquals('multipleOf', $parameters[0]['failure']); @@ -233,7 +208,7 @@ public function testValidateFailureMultipleOf() /** * Validate against common enum keyword */ - public function testValidateCommon() + public function testValidateCommon(): void { $validator = (new NumberValidator(0, 10)); @@ -252,7 +227,7 @@ public function testValidateCommon() ); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('number', $this->object->getType()); } diff --git a/tests/src/ObjectValidatorTest.php b/tests/src/ObjectValidatorTest.php index cf32891..bd4e44b 100644 --- a/tests/src/ObjectValidatorTest.php +++ b/tests/src/ObjectValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Phramework\Exceptions\IncorrectParametersException; @@ -37,43 +38,42 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input return [ - [(object)['ok' => true, 'str2' => 'my str']], - [(object)['ok' => 'true', 'okk' => '123']], - [(object)['ok' => false, 'okk' => 'xyz' ]], + 'valid 1' => [(object)['ok' => true, 'str2' => 'my str']], + 'valid 2' => [(object)['ok' => 'true', 'okk' => '123']], + 'valid 3' => [(object)['ok' => false, 'okk' => 'xyz' ]], ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - [1], //not an array or object - [['ok']], //`ok` is not an object key - [['abc']], - [(object)['str' => 'my strxxxxxxxxxxx', 'ok' => false]], - [(object)['str' => 'my str', 'okk' => false]], - [(object)(['okk' => 'hello'])], //because missing ok - [['ok'=> 'omg', 'okk' => '2']], //because of ok is not boolean - [(object)['ok' => 'true', 'str' => 'my str', 'okk' => '123']], //maxProperties - [(object)['ok' => 'true']] //minProperties + 'not an object' => [1], //not an array or object + 'ok not key' => [['ok']], //`ok` is not an object key + 'simple array' => [['abc']], + 'str too long' => [(object)['str' => 'my strxxxxxxxxxxx', 'ok' => false]], + 'str okk false' => [(object)['str' => 'my str', 'okk' => false]], + 'missing ok' => [(object)(['okk' => 'hello'])], //because missing ok + 'ok not boolean' => [['ok'=> 'omg', 'okk' => '2']], //because of ok is not boolean + 'maxProperties' => [(object)['ok' => 'true', 'str' => 'my str', 'okk' => '123']], //maxProperties + 'minProperties' => [(object)['ok' => 'true']] //minProperties ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new ObjectValidator(); + $this->assertInstanceOf(ObjectValidator::class, $validator); } - /** - * @expectedException \Exception - */ - public function testConstructFailure() + public function testConstructFailure(): void { - $validator = new ObjectValidator( + $this->expectException(\Exception::class); + new ObjectValidator( [], [], null, @@ -81,12 +81,10 @@ public function testConstructFailure() ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure1() + public function testConstructFailure1(): void { - $validator = new ObjectValidator( + $this->expectException(\Exception::class); + new ObjectValidator( [], [], null, @@ -95,12 +93,10 @@ public function testConstructFailure1() ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure2() + public function testConstructFailure2(): void { - $validator = new ObjectValidator( + $this->expectException(\Exception::class); + new ObjectValidator( [], [], [], @@ -109,25 +105,21 @@ public function testConstructFailure2() ); } - /** - * @todo MUST be remove when BaseValidator are supported for "additionalProperties" - * @expectedException \Exception - */ - public function testConstructFailure3() + public function testConstructFailure3(): void { - $validator = new ObjectValidator( + // @todo MUST be remove when BaseValidator are supported for "additionalProperties" + $this->expectException(\Exception::class); + new ObjectValidator( (object)['obj' => new IntegerValidator()], ['obj'], new IntegerValidator() ); } - /** - * @expectedException \Exception - */ - public function testConstructFailure4() + public function testConstructFailure4(): void { - $validator = new ObjectValidator( + $this->expectException(\Exception::class); + new ObjectValidator( [], [], [], @@ -137,18 +129,16 @@ public function testConstructFailure4() ); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(object $input): void { $return = $this->object->validate($input); $this->assertTrue($return->status); - $this->assertInternalType('object', $return->value); + $this->assertIsObject($return->value); } - public function testValidateDependencies() + public function testValidateDependencies(): void { $validator = new ObjectValidator( (object) [ @@ -188,7 +178,7 @@ public function testValidateDependencies() ]); } - public function testValidateRecursiveSuccess() + public function testValidateRecursiveSuccess(): void { $validationObject = new ObjectValidator( [ @@ -282,23 +272,20 @@ public function testValidateRecursiveSuccess() $parsed->request->response->default ); - $this->assertInternalType( - 'array', + $this->assertIsArray( $parsed->request->response->ruleObjects ); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); $this->assertFalse($return->status); } - public function testValidateFailureMissing() + public function testValidateFailureMissing(): void { $validationObject = new ObjectValidator( [ @@ -349,7 +336,7 @@ public function testValidateFailureMissing() $return->errorObject ); } - public function testValidateFailureAdditionalProperties() + public function testValidateFailureAdditionalProperties(): void { $validationObject = new ObjectValidator( [ @@ -367,7 +354,7 @@ public function testValidateFailureAdditionalProperties() $this->assertFalse($return->status); $this->assertInstanceOf( - 'Phramework\\Exceptions\\IncorrectParametersException', + \Phramework\Exceptions\IncorrectParametersException::class, $return->errorObject ); @@ -376,9 +363,7 @@ public function testValidateFailureAdditionalProperties() $this->assertEquals('additionalProperties', $parameters[0]['failure']); } - /** - */ - public function testAddPropertiesSuccess() + public function testAddPropertiesSuccess(): void { $originalPropertiesCount = count(get_object_vars( $this->object->properties @@ -393,26 +378,20 @@ public function testAddPropertiesSuccess() ); } - /** - * @expectedException \Exception - */ - public function testAddPropertiesFailure() + public function testAddPropertiesFailure(): void { + $this->expectException(\Exception::class); $properties = 104; $this->object->addProperties($properties); //Not an array } - /** - * @expectedException \Exception - */ - public function testAddPropertiesFailure2() + public function testAddPropertiesFailure2(): void { + $this->expectException(\Exception::class); $this->object->addProperties([]); } - /** - */ - public function testAddPropertySuccess() + public function testAddPropertySuccess(): void { $key = 'my_key'; $property = new ObjectValidator(); @@ -423,23 +402,21 @@ public function testAddPropertySuccess() ); } - /** - * @expectedException \Exception - */ - public function testAddPropertyFailure() + public function testAddPropertyFailure(): void { + $this->expectException(\Exception::class); $property = new ObjectValidator(); $this->object->addProperty('new', $property); $this->object->addProperty('new', $property); //With same key } - public function testGetType() + public function testGetType(): void { $this->assertEquals('object', $this->object->getType()); } - public function testParseSuccess() + public function testParseSuccess(): void { $input = (object)[ 'weight' => '5', @@ -466,20 +443,18 @@ public function testParseSuccess() $record = $validationObject->parse($input); - $this->assertInternalType('object', $record); - $this->assertInternalType('object', $record->obj); - $this->assertInternalType('float', $record->obj->not_required); + $this->assertIsObject($record); + $this->assertIsObject($record->obj); + $this->assertIsFloat($record->obj->not_required); $this->assertEquals(5, $record->weight); $this->assertTrue($record->obj->valid); $this->assertEquals(5.5, $record->obj->not_required); } - /** - * @expectedException \Exception - * @todo \Phramework\Exceptions\MissingParametersException - */ - public function testParseFailure() + public function testParseFailure(): void { + $this->expectException(\Exception::class); + // @todo \Phramework\Exceptions\MissingParametersException $input = [ 'weight' => '5', 'obj' => [ @@ -504,15 +479,13 @@ public function testParseFailure() ['weight'] //required ); - $record = $validationObject->parse($input); + $validationObject->parse($input); } - /** - * @expectedException \Exception - * @todo \Phramework\Exceptions\IncorrectParametersException - */ - public function testParseFailure2() + public function testParseFailure2(): void { + $this->expectException(\Exception::class); + // @todo \Phramework\Exceptions\IncorrectParametersException $input = [ 'weight' => '555', //out of range 'obj' => [ @@ -537,10 +510,10 @@ public function testParseFailure2() ['weight'] //required ); - $record = $validationObject->parse($input); + $validationObject->parse($input); } - public function testSetValidateCallback() + public function testSetValidateCallback(): void { $value = 10; @@ -573,7 +546,7 @@ public function testSetValidateCallback() $this->assertNull($parsed); } - public function testValidateSetDefault() + public function testValidateSetDefault(): void { $validator = (new ObjectValidator( (object) [ @@ -595,7 +568,7 @@ public function testValidateSetDefault() //Use root default $parsed = $validator->parse((object) []); - $this->assertInternalType('object', $parsed->address); + $this->assertIsObject($parsed->address); $this->assertSame(-1, $parsed->address->floor); //Use default @@ -616,7 +589,7 @@ public function testValidateSetDefault() $this->assertSame(1, $parsed->address->floor); } - public function testValidateSetDefaultNull() + public function testValidateSetDefaultNull(): void { $validator = (new ObjectValidator( (object) [ @@ -629,7 +602,7 @@ public function testValidateSetDefaultNull() $this->assertNull($parsed); } - public function testXVisibility() + public function testXVisibility(): void { $validator = new ObjectValidator( (object) [ @@ -669,7 +642,7 @@ public function testXVisibility() $this->markTestIncomplete(); } - public function testXVisibilityOR() + public function testXVisibilityOR(): void { $validator = new ObjectValidator( (object) [ @@ -718,7 +691,7 @@ public function testXVisibilityOR() $this->markTestIncomplete(); } - public function testXVisibilitySubset() + public function testXVisibilitySubset(): void { $validator = new ObjectValidator( (object) [ diff --git a/tests/src/OneOfTest.php b/tests/src/OneOfTest.php index 9f8a339..c205d9b 100644 --- a/tests/src/OneOfTest.php +++ b/tests/src/OneOfTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class OneOfTest extends TestCase @@ -37,35 +38,35 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - [0, 0], //exists only in UnsignedIntegerValidator - [-2, -2], //exists only in IntegerValidator - [2, 2], //exists only in UnsignedIntegerValidator - [100, 100], //exists only in UnsignedIntegerValidator - [13.4, 13.4], //exists only in Number - [[1, 2], [1, 2]], - [ + 'unsigned integer 0' => [0, 0], //exists only in UnsignedIntegerValidator + 'signed integer -2' => [-2, -2], //exists only in IntegerValidator + 'unsigned integer 2' => [2, 2], //exists only in UnsignedIntegerValidator + 'unsigned integer 100' => [100, 100], //exists only in UnsignedIntegerValidator + 'number 13.4' => [13.4, 13.4], //exists only in Number + 'array' => [[1, 2], [1, 2]], + 'object' => [ (object)['a' => 1], (object)['a' => 1] ], - ['ab', 'ab'], //exists only in first string - ['ababab', 'ababab'] //exists only in first string + 'string "ab"' => ['ab', 'ab'], //exists only in first string + 'string "ababab"' => ['ababab', 'ababab'] //exists only in first string ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - [10], //exists in two - ['abc', 'abc'] //exists in both string + 'integer 10 (in two validators)' => [10], //exists in two + 'string "abc" (in two validators)' => ['abc'] //exists in both string ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new OneOf([ new StringValidator(), @@ -75,20 +76,17 @@ public function testConstruct() new StringValidator() ) ]); + $this->assertInstanceOf(OneOf::class, $validator); } - /** - * @expectedException \Exception - */ - public function testConstructFailure() + public function testConstructFailure(): void { - $validator = new OneOf(['{"type": "integer"}']); + $this->expectException(\Exception::class); + new OneOf(['{"type": "integer"}']); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(mixed $input, mixed $expected): void { $return = $this->object->validate($input); @@ -97,17 +95,15 @@ public function testValidateSuccess($input, $expected) $this->assertEquals($expected, $return->value); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input = null) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input = null): void { $return = $this->object->validate($input); - $this->assertEquals(false, $return->status); + $this->assertFalse($return->status); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "oneOf": [ @@ -131,25 +127,23 @@ public function testCreateFromJSON() $this->assertInstanceOf(OneOf::class, $validator); - $this->assertInternalType('array', $validator->oneOf); - - //Set validator - $this->object = $validator; - - $this->testValidateSuccess('a', 'a'); - $this->testValidateSuccess('abced', 'abced'); - $this->testValidateSuccess(10, 10); + $this->assertIsArray($validator->oneOf); - $this->testValidateFailure('10'); - $this->testValidateFailure('abc'); + //Test success + $this->assertTrue($validator->validate('a')->status); + $this->assertTrue($validator->validate('abced')->status); + $this->assertTrue($validator->validate(10)->status); - $this->setUp(); + //Test failure because it matches multiple schemas + $this->assertFalse($validator->validate('10')->status); + //Test failure because it matches two schemas + $this->assertFalse($validator->validate('abc')->status); } /** * Validate against common enum keyword */ - public function testValidateCommon() + public function testValidateCommon(): void { $validator = $this->object; @@ -180,7 +174,7 @@ public function testValidateCommon() ); } - public function testGetType() + public function testGetType(): void { $this->assertSame(null, $this->object->getType()); } diff --git a/tests/src/StringValidatorTest.php b/tests/src/StringValidatorTest.php index 1128e9d..f20eae5 100644 --- a/tests/src/StringValidatorTest.php +++ b/tests/src/StringValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -11,7 +12,7 @@ class StringValidatorTest extends TestCase { /** - * @var String + * @var StringValidator */ protected $object; @@ -36,80 +37,73 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - ['abx34scd3', 'abx34scd3'], - ['abcd0', 'abcd0'], - ['a2cx2', 'a2cx2'], + 'valid 1' => ['abx34scd3', 'abx34scd3'], + 'valid 2' => ['abcd0', 'abcd0'], + 'valid 3' => ['a2cx2', 'a2cx2'], ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - [''], - [new \stdClass()], - [['x', 'array']], //because of type - [1], //because of type - [2], - [-10], - ['az9'], //because of minLength - ['abc'], //because of pattern - ['9abc4'], //because of pattern - ['asssssssssssssssssssbc9'], //because of maxLength + 'empty string' => [''], + 'object' => [new \stdClass()], + 'array' => [['x', 'array']], //because of type + 'integer 1' => [1], //because of type + 'integer 2' => [2], + 'integer -10' => [-10], + 'too short' => ['az9'], //because of minLength + 'pattern mismatch 1' => ['abc'], //because of pattern + 'pattern mismatch 2' => ['9abc4'], //because of pattern + 'too long' => ['asssssssssssssssssssbc9'], //because of maxLength ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new StringValidator(); + $this->assertInstanceOf(StringValidator::class, $validator); } - /** - * @expectedException \Exception - */ - public function testConstructFailure() + public function testConstructFailure(): void { - $validator = new StringValidator(-1); + $this->expectException(\Exception::class); + new StringValidator(-1); } - /** - * @expectedException \Exception - */ - public function testConstructFailure2() + public function testConstructFailure2(): void { - $validator = new StringValidator(3, 2); + $this->expectException(\Exception::class); + new StringValidator(3, 2); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string $input, string $expected): void { $return = $this->object->validate($input); - $this->assertInternalType('string', $return->value); - $this->assertEquals($expected, $return->value); + $this->assertIsString($return->value); + $this->assertSame($expected, $return->value); $this->assertTrue($return->status); } - public function testValidateSuccessRaw() + public function testValidateSuccessRaw(): void { $this->object->raw = true; $return = $this->object->validate('abx34scd3'); - $this->assertInternalType('string', $return->value); - $this->assertEquals('abx34scd3', $return->value); + $this->assertIsString($return->value); + $this->assertSame('abx34scd3', $return->value); $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); @@ -119,7 +113,7 @@ public function testValidateFailure($input) /** * Validate against common enum keyword */ - public function testValidateCommon() + public function testValidateCommon(): void { $validator = (new StringValidator(0, 10)); @@ -138,7 +132,7 @@ public function testValidateCommon() ); } - public function testGetType() + public function testGetType(): void { $this->assertEquals('string', $this->object->getType()); } diff --git a/tests/src/StringWithDatetimeFormatValidatorTest.php b/tests/src/StringWithDatetimeFormatValidatorTest.php index bf64a1d..77eaa42 100644 --- a/tests/src/StringWithDatetimeFormatValidatorTest.php +++ b/tests/src/StringWithDatetimeFormatValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class StringWithDatetimeFormatValidatorTest extends TestCase @@ -26,63 +27,59 @@ protected function setUp(): void $this->object->setFormatMaximum('2020-11-14T14:30:26+02:00'); } - public function validateSuccessProvider(): array + public static function validateSuccessProvider(): array { //input, expected return [ - ['2019-11-14T14:30:26+02:00', '2019-11-14T14:30:26+02:00'], - ['2019-11-14T14:30:26+0200', '2019-11-14T14:30:26+0200'], - ['2019-11-14T14:30:60+02:00', '2019-11-14T14:30:60+02:00'], - ['2019-11-14T14:30:60+00:00', '2019-11-14T14:30:60+00:00'], - ['2019-11-14T14:30:45-05:00', '2019-11-14T14:30:45-05:00'], - ['2019-11-14T00:00:00-05:00', '2019-11-14T00:00:00-05:00'], - ['2019-11-14T14:30:26Z', '2019-11-14T14:30:26Z'], - ['2018-11-14T14:30:26+02:00', '2018-11-14T14:30:26+02:00'], - ['2020-11-14T14:30:26+02:00', '2020-11-14T14:30:26+02:00'], - ['2020-02-28T00:30:26+02:00', '2020-02-28T00:30:26+02:00'], - ['2020-02-28T00:30:26+02', '2020-02-28T00:30:26+02'], + 'valid with colon in offset' => ['2019-11-14T14:30:26+02:00', '2019-11-14T14:30:26+02:00'], + 'valid without colon in offset' => ['2019-11-14T14:30:26+0200', '2019-11-14T14:30:26+0200'], + 'valid with leap second' => ['2019-11-14T14:30:60+02:00', '2019-11-14T14:30:60+02:00'], + 'valid with leap second and Z offset' => ['2019-11-14T14:30:60+00:00', '2019-11-14T14:30:60+00:00'], + 'valid with negative offset' => ['2019-11-14T14:30:45-05:00', '2019-11-14T14:30:45-05:00'], + 'valid midnight' => ['2019-11-14T00:00:00-05:00', '2019-11-14T00:00:00-05:00'], + 'valid Z offset' => ['2019-11-14T14:30:26Z', '2019-11-14T14:30:26Z'], + 'valid at minimum' => ['2018-11-14T14:30:26+02:00', '2018-11-14T14:30:26+02:00'], + 'valid at maximum' => ['2020-11-14T14:30:26+02:00', '2020-11-14T14:30:26+02:00'], + 'valid leap year date' => ['2020-02-28T00:30:26+02:00', '2020-02-28T00:30:26+02:00'], + 'valid short offset' => ['2020-02-28T00:30:26+02', '2020-02-28T00:30:26+02'], ]; } - public function validateFailureProvider(): array + public static function validateFailureProvider(): array { //input return [ - ['2019-11-14T14:30:26Z+02:00', 'date-time'], - ['2019-11-14T', 'minLength'], - ['2019-11-14 14:30:26+02:00', 'date-time'], - ['2019-11-14T14:30:26+02:00random', 'date-time'], - ['2019-11-14T14:30:26.123543333654+02:00', 'maxLength'], - ['2019-02-30T01:01:01Z', 'date-time'], - ['2019-13-30T01:01:01Z', 'date-time'], - ['asdfasdf', 'minLength'], - ['a708465e-8fec-4508-b159-46d545de3b', 'date-time'], - ['2019-11-14T00:00:00-99:00', 'date-time'], - ['2019-11-14T00:80:00-00:00', 'date-time'], - ['2017-11-14T14:30:26+02:00', 'formatMinimum'], - ['2023-11-14T14:30:26+02:00', 'formatMaximum'], - ['2019-11-14T14:30:45-05::00', 'date-time'], - ['2020-02-28T00:30:26+02:', 'date-time'], + 'Z and offset' => ['2019-11-14T14:30:26Z+02:00', 'date-time'], + 'too short' => ['2019-11-14T', 'minLength'], + 'space instead of T' => ['2019-11-14 14:30:26+02:00', 'date-time'], + 'random suffix' => ['2019-11-14T14:30:26+02:00random', 'date-time'], + 'too long' => ['2019-11-14T14:30:26.123543333654+02:00', 'maxLength'], + 'invalid day' => ['2019-02-30T01:01:01Z', 'date-time'], + 'invalid month' => ['2019-13-30T01:01:01Z', 'date-time'], + 'random string' => ['asdfasdf', 'minLength'], + 'uuid like' => ['a708465e-8fec-4508-b159-46d545de3b', 'date-time'], + 'invalid offset hour' => ['2019-11-14T00:00:00-99:00', 'date-time'], + 'invalid minute' => ['2019-11-14T00:80:00-00:00', 'date-time'], + 'before minimum' => ['2017-11-14T14:30:26+02:00', 'formatMinimum'], + 'after maximum' => ['2023-11-14T14:30:26+02:00', 'formatMaximum'], + 'double colon in offset' => ['2019-11-14T14:30:45-05::00', 'date-time'], + 'trailing colon in offset' => ['2020-02-28T00:30:26+02:', 'date-time'], ]; } - /** - * @dataProvider validateSuccessProvider - */ + #[DataProvider('validateSuccessProvider')] public function testValidateSuccess( string $input, string $expected ): void { $return = $this->object->validate($input); - $this->assertInternalType('string', $return->value); - $this->assertEquals($expected, $return->value); + $this->assertIsString($return->value); + $this->assertSame($expected, $return->value); $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ + #[DataProvider('validateFailureProvider')] public function testValidateFailure( string $input, string $failure @@ -97,7 +94,7 @@ public function testValidateFailure( 'failure' => $failure ]; - $this->assertAttributeContains($expectedError, 'parameters', $return->errorObject); + $this->assertContains($expectedError, $return->errorObject->getParameters()); } public function testCreateFromJSON(): void @@ -134,7 +131,7 @@ public function testCreateFromJSON(): void 'failure' => 'formatMinimum' ]; - $this->assertAttributeContains($expectedError, 'parameters', $return->errorObject); + $this->assertContains($expectedError, $return->errorObject->getParameters()); $return = $validator->validate('2019-12-14T22:45:38+00:00'); @@ -146,7 +143,7 @@ public function testCreateFromJSON(): void 'failure' => 'formatMaximum' ]; - $this->assertAttributeContains($expectedError, 'parameters', $return->errorObject); + $this->assertContains($expectedError, $return->errorObject->getParameters()); $return = $validator->validate('2019-12-12T22:25:38+00:00'); @@ -161,6 +158,6 @@ public function testCreateFromJSON(): void public function testGetType(): void { - $this->assertEquals('string', $this->object->getType()); + $this->assertSame('string', $this->object->getType()); } } diff --git a/tests/src/URLValidatorTest.php b/tests/src/URLValidatorTest.php index 511898e..bed25f2 100644 --- a/tests/src/URLValidatorTest.php +++ b/tests/src/URLValidatorTest.php @@ -2,13 +2,14 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class URLValidatorTest extends TestCase { /** - * @var URL + * @var URLValidator */ protected $object; @@ -29,58 +30,55 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { - //input, expected + //input return [ - ['https://nohponex.gr'], - ['http://www.thmmy.gr/dir/file.php?param=ok&second=false#ok'], - ['http://127.0.0.1/app'] + 'simple https' => ['https://nohponex.gr'], + 'http with path, query, fragment' => ['http://www.thmmy.gr/dir/file.php?param=ok&second=false#ok'], + 'http with ip' => ['http://127.0.0.1/app'] ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['100'], - [540], - ['nx@ma.il'], - ['nohponex@gmailcom'], - ['http::://nohponex.gr'], - ['nohponex.gr'], - ['nohponex'], - ['//nohponex.gr'] + 'string number' => ['100'], + 'integer' => [540], + 'email-like' => ['nx@ma.il'], + 'email-like no dot' => ['nohponex@gmailcom'], + 'double colon' => ['http::://nohponex.gr'], + 'no scheme' => ['nohponex.gr'], + 'just domain part' => ['nohponex'], + 'scheme relative' => ['//nohponex.gr'] ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new URLValidator(); + $this->assertInstanceOf(URLValidator::class, $validator); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string $input): void { $return = $this->object->validate($input); - $this->assertInternalType('string', $return->value); + $this->assertIsString($return->value); $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); $this->assertFalse($return->status); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "url", @@ -103,8 +101,8 @@ public function testCreateFromJSON() ); } - public function testGetType() + public function testGetType(): void { - $this->assertEquals('url', $this->object->getType()); + $this->assertSame('url', $this->object->getType()); } } diff --git a/tests/src/UUIDv4ValidatorTest.php b/tests/src/UUIDv4ValidatorTest.php index b6e4ba5..25ff847 100644 --- a/tests/src/UUIDv4ValidatorTest.php +++ b/tests/src/UUIDv4ValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -32,58 +33,55 @@ protected function tearDown(): void { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { - //input, expected + //input return [ - ['20b33445-7464-41c5-a47d-c6c41e29c77d'], - ['2015f512-e39c-4093-b2c6-958030b57764'], - ['db3f6f4b-df60-4b7f-bf4a-8e6bc578550c'], - ['e1da5d7f-2d32-4cf9-b42e-9b06817c6495'], + 'valid uuid 1' => ['20b33445-7464-41c5-a47d-c6c41e29c77d'], + 'valid uuid 2' => ['2015f512-e39c-4093-b2c6-958030b57764'], + 'valid uuid 3' => ['db3f6f4b-df60-4b7f-bf4a-8e6bc578550c'], + 'valid uuid 4' => ['e1da5d7f-2d32-4cf9-b42e-9b06817c6495'], ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['100'], - [5400000], - ['this is an invalid string if you consider it as uuid'], - ['knikolopoulos@vivantehealth.com'], - ['asdasdasd-asdasdasdasd-asdasdasdasd-asdasdasd'], - ['e1da5d7f-2d32-4cf9-b42e-9b06817c6495-9b06817c6495'], - ['e1da5d7f-2d32-4cf9-b42e'], + 'string number' => ['100'], + 'integer' => [5400000], + 'long string' => ['this is an invalid string if you consider it as uuid'], + 'email' => ['knikolopoulos@vivantehealth.com'], + 'invalid format' => ['asdasdasd-asdasdasdasd-asdasdasdasd-asdasdasd'], + 'too long' => ['e1da5d7f-2d32-4cf9-b42e-9b06817c6495-9b06817c6495'], + 'too short' => ['e1da5d7f-2d32-4cf9-b42e'], ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new UUIDv4Validator(); + $this->assertInstanceOf(UUIDv4Validator::class, $validator); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string $input): void { $return = $this->object->validate($input); - $this->assertInternalType('string', $return->value); + $this->assertIsString($return->value); $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void { $return = $this->object->validate($input); $this->assertFalse($return->status); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "UUIDv4" @@ -94,8 +92,8 @@ public function testCreateFromJSON() $this->assertInstanceOf(UUIDv4Validator::class, $validationObject); } - public function testGetType() + public function testGetType(): void { - $this->assertEquals('UUIDv4', $this->object->getType()); + $this->assertSame('UUIDv4', $this->object->getType()); } } diff --git a/tests/src/UnsignedIntegerValidatorTest.php b/tests/src/UnsignedIntegerValidatorTest.php index dfebe56..7018dbb 100644 --- a/tests/src/UnsignedIntegerValidatorTest.php +++ b/tests/src/UnsignedIntegerValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -24,44 +25,43 @@ protected function setUp(): void $this->object = new UnsignedIntegerValidator(10, 1000, true); } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - ['100', 100], - [124, 124] + 'string 100' => ['100', 100], + 'integer 124' => [124, 124] ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['-0x'], - ['abc'], - ['+xyz'] - [-1000], - ['-4'], - [4], //because of min, - [1.4], - [-13.5] + 'hex string' => ['-0x'], + 'alpha string' => ['abc'], + 'plus string' => ['+xyz'], + 'negative integer' => [-1000], + 'negative string' => ['-4'], + 'below minimum' => [4], //because of min + 'float value' => [1.4], + 'negative float' => [-13.5] ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new UnsignedIntegerValidator( 0, 1 ); + $this->assertInstanceOf(UnsignedIntegerValidator::class, $validator); } - /** - * @expectedException \Exception - */ - public function testConstructFailure() + public function testConstructFailure(): void { - $validator = new UnsignedIntegerValidator( + $this->expectException(\Exception::class); + new UnsignedIntegerValidator( -1 ); } @@ -69,24 +69,30 @@ public function testConstructFailure() /** * Helper method */ - private function validateSuccess(UnsignedIntegerValidator $object, $input, $expected) + private function validateSuccess(UnsignedIntegerValidator $object, string|int $input, int $expected): void { $return = $object->validate($input); $this->assertTrue($return->status); - $this->assertInternalType('integer', $return->value); + $this->assertIsInt($return->value); $this->assertSame($expected, $return->value); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input, $expected) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string|int $input, int $expected): void { $this->validateSuccess($this->object, $input, $expected); } - public function testCreateFromJSON() + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(mixed $input): void + { + $return = $this->object->validate($input); + + $this->assertFalse($return->status); + } + + public function testCreateFromJSON(): void { $json = '{ "type": "unsignedinteger" @@ -97,7 +103,7 @@ public function testCreateFromJSON() $this->assertInstanceOf(UnsignedIntegerValidator::class, $validationObject); } - public function testCreateFromJSONAlias() + public function testCreateFromJSONAlias(): void { $json = '{ "type": "uint" @@ -108,8 +114,8 @@ public function testCreateFromJSONAlias() $this->assertInstanceOf(UnsignedIntegerValidator::class, $validationObject); } - public function testGetType() + public function testGetType(): void { - $this->assertEquals('unsignedinteger', $this->object->getType()); + $this->assertSame('unsignedinteger', $this->object->getType()); } } diff --git a/tests/src/UsernameValidatorTest.php b/tests/src/UsernameValidatorTest.php index ee021fa..ca32fa9 100644 --- a/tests/src/UsernameValidatorTest.php +++ b/tests/src/UsernameValidatorTest.php @@ -2,6 +2,7 @@ namespace Phramework\Validate; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -29,59 +30,56 @@ protected function setUp(): void * This method is called after a test is executed. */ protected function tearDown(): void - { + { } - public function validateSuccessProvider() + public static function validateSuccessProvider(): array { //input, expected return [ - ['nohponex'], - ['NohponeX'], - ['nohp_onex'], - ['nohp_o.nex'] + 'lowercase' => ['nohponex'], + 'mixed case' => ['NohponeX'], + 'with underscore' => ['nohp_onex'], + 'with dot' => ['nohp_o.nex'] ]; } - public function validateFailureProvider() + public static function validateFailureProvider(): array { //input return [ - ['too short' => 'ni'], - ['too long' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'], - ['invalid character' => 'nohponεξ'], - ['invalid character +' => '+nohponex'], - ['invalid character @' => '@nohponex'], + 'too short' => ['ni'], + 'too long' => ['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'], + 'invalid character epsilon' => ['nohponεξ'], + 'invalid character +' => ['+nohponex'], + 'invalid character @' => ['@nohponex'], ]; } - public function testConstruct() + public function testConstruct(): void { $validator = new UsernameValidator(); + $this->assertInstanceOf(UsernameValidator::class, $validator); } - /** - * @dataProvider validateSuccessProvider - */ - public function testValidateSuccess($input) + #[DataProvider('validateSuccessProvider')] + public function testValidateSuccess(string $input): void { $return = $this->object->validate($input); - $this->assertInternalType('string', $return->value); + $this->assertIsString($return->value); $this->assertTrue($return->status); } - /** - * @dataProvider validateFailureProvider - */ - public function testValidateFailure($input) + #[DataProvider('validateFailureProvider')] + public function testValidateFailure(string $input): void { $return = $this->object->validate($input); $this->assertFalse($return->status); } - public function testCreateFromJSON() + public function testCreateFromJSON(): void { $json = '{ "type": "username" @@ -92,22 +90,23 @@ public function testCreateFromJSON() $this->assertInstanceOf(UsernameValidator::class, $validationObject); } - public function testGetType() + public function testGetType(): void { - $this->assertEquals('username', $this->object->getType()); + $this->assertSame('username', $this->object->getType()); } - public function testSetUsernamePattern() + public function testGetAndSetUsernamePattern(): void { - UsernameValidator::setUsernamePattern('/^[A-Za-z0-9_\.]{3,32}$/'); - } - - public function testGetUsernamePattern() - { - $pattern = '/^[A-Za-z0-9_\.]{3,6}$/'; - - UsernameValidator::setUsernamePattern($pattern); - - $this->assertSame($pattern, UsernameValidator::getUsernamePattern()); + $originalPattern = UsernameValidator::getUsernamePattern(); + + try { + $pattern = '/^[a-z]+$/'; + UsernameValidator::setUsernamePattern($pattern); + $this->assertSame($pattern, UsernameValidator::getUsernamePattern()); + } finally { + //Restore original pattern to not affect other tests + UsernameValidator::setUsernamePattern($originalPattern); + } } } + diff --git a/tests/src/ValidateResultTest.php b/tests/src/ValidateResultTest.php index f0df9d7..9f0508c 100644 --- a/tests/src/ValidateResultTest.php +++ b/tests/src/ValidateResultTest.php @@ -3,28 +3,39 @@ namespace Phramework\Validate; use PHPUnit\Framework\TestCase; +use Phramework\Exceptions\IncorrectParametersException; class ValidateResultTest extends TestCase { - - /** - * Sets up the fixture, for example, opens a network connection. - * This method is called before a test is executed. - */ - protected function setUp(): void + public function testConstruct(): void { - } + $value = 'test-value'; + $status = true; + $errorObject = new \Exception('test-error'); - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - */ - protected function tearDown(): void - { + $validateResult = new ValidateResult($value, $status, $errorObject); + + $this->assertInstanceOf(ValidateResult::class, $validateResult); + $this->assertSame($value, $validateResult->value); + $this->assertSame($status, $validateResult->status); + $this->assertSame($errorObject, $validateResult->errorObject); } - public function testConstruct() + public function testJsonSerialize(): void { - $validator = new ValidateResult(true, true); + $value = 'test-value'; + $status = true; + $errorObject = new IncorrectParametersException([ + ['type' => 'string', 'failure' => 'minLength'] + ]); + + $validateResult = new ValidateResult($value, $status, $errorObject); + + $json = json_encode($validateResult); + $decoded = json_decode($json, true); + + $this->assertSame($value, $decoded['value']); + $this->assertSame($status, $decoded['status']); + $this->assertIsArray($decoded['errorObject']); } }