diff --git a/composer.json b/composer.json index 10ad86647..a026705cb 100644 --- a/composer.json +++ b/composer.json @@ -23,10 +23,10 @@ "friendsofphp/php-cs-fixer": "^3.4.0", "phpbench/phpbench": "^1.2.3", "phpunit/phpunit": "^9.5.16", - "vimeo/psalm": "^4.21.0", - "php-standard-library/psalm-plugin": "^2.0.2", + "vimeo/psalm": "^5.0.0", + "php-standard-library/psalm-plugin": "dev-better-pipe", "php-coveralls/php-coveralls": "^2.5.2", - "roave/infection-static-analysis-plugin": "^1.23.0" + "roave/infection-static-analysis-plugin": "^1.26.0" }, "autoload": { "psr-4": { @@ -57,5 +57,11 @@ }, "suggest": { "php-standard-library/psalm-plugin": "Psalm integration" - } + }, + "repositories": [ + { + "type": "path", + "url": "../psalm-plugin" + } + ] } diff --git a/composer.lock b/composer.lock index 1072ea60e..db70babd6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d12f0f793f53502560c83e31358b64f5", + "content-hash": "b3ee72818d58784f8ab2bc6ec63c1b95", "packages": [ { "name": "revolt/event-loop", @@ -2260,21 +2260,15 @@ }, { "name": "php-standard-library/psalm-plugin", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-standard-library/psalm-plugin.git", - "reference": "acec87621b2a08b907d40b46c5551215eb4b2154" - }, + "version": "dev-better-pipe", "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-standard-library/psalm-plugin/zipball/acec87621b2a08b907d40b46c5551215eb4b2154", - "reference": "acec87621b2a08b907d40b46c5551215eb4b2154", - "shasum": "" + "type": "path", + "url": "../psalm-plugin", + "reference": "02b9e199cec2625d22ebe35dc52668d8b49bb61b" }, "require": { "php": "^8.1", - "vimeo/psalm": "^4.20 || ^5.0" + "vimeo/psalm": "^5.0" }, "conflict": { "azjezz/psl": "<2.0" @@ -2295,7 +2289,33 @@ "Psl\\Psalm\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "cs:fix": [ + "phpcbf", + "php-cs-fixer fix" + ], + "cs:check": [ + "phpcs", + "php-cs-fixer fix --dry-run" + ], + "type:check": [ + "psalm" + ], + "type:coverage": [ + "psalm --shepherd" + ], + "code:coverage": [ + "php-coveralls -v" + ], + "security:analysis": [ + "psalm --taint-analysis" + ], + "check": [ + "@cs:check", + "@type:check", + "@security:analysis" + ] + }, "license": [ "MIT" ], @@ -2306,11 +2326,9 @@ } ], "description": "Psalm plugin for the PHP Standard Library", - "support": { - "issues": "https://github.com/php-standard-library/psalm-plugin/issues", - "source": "https://github.com/php-standard-library/psalm-plugin/tree/2.0.2" - }, - "time": "2022-02-27T20:08:05+00:00" + "transport-options": { + "relative": true + } }, { "name": "phpbench/container", @@ -3497,28 +3515,28 @@ }, { "name": "roave/infection-static-analysis-plugin", - "version": "1.25.0", + "version": "1.26.0", "source": { "type": "git", "url": "https://github.com/Roave/infection-static-analysis-plugin.git", - "reference": "f0b6b72dc9e378fdf0cadf440bc2b8061333392e" + "reference": "63f3fe01f0d29409501a9999f60ef0602ddfb4cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/infection-static-analysis-plugin/zipball/f0b6b72dc9e378fdf0cadf440bc2b8061333392e", - "reference": "f0b6b72dc9e378fdf0cadf440bc2b8061333392e", + "url": "https://api.github.com/repos/Roave/infection-static-analysis-plugin/zipball/63f3fe01f0d29409501a9999f60ef0602ddfb4cb", + "reference": "63f3fe01f0d29409501a9999f60ef0602ddfb4cb", "shasum": "" }, "require": { "infection/infection": "0.26.16", - "ocramius/package-versions": "^1.9.0 || ^2.0.0", - "php": "~8.0.0|~8.1.0|~8.2.0", + "ocramius/package-versions": "^2.7.0", + "php": "~8.1.0 || ~8.2.0", "sanmai/later": "^0.1.2", - "vimeo/psalm": "^4.29.0" + "vimeo/psalm": "^4.30.0 || ^5.0.0" }, "require-dev": { "doctrine/coding-standard": "^10.0.0", - "phpunit/phpunit": "^9.5.25" + "phpunit/phpunit": "^9.5.26" }, "bin": [ "bin/roave-infection-static-analysis-plugin" @@ -3542,9 +3560,9 @@ "description": "Static analysis on top of mutation testing - prevents escaped mutants from being invalid according to static analysis", "support": { "issues": "https://github.com/Roave/infection-static-analysis-plugin/issues", - "source": "https://github.com/Roave/infection-static-analysis-plugin/tree/1.25.0" + "source": "https://github.com/Roave/infection-static-analysis-plugin/tree/1.26.0" }, - "time": "2022-10-22T11:43:05+00:00" + "time": "2022-11-30T16:04:59+00:00" }, { "name": "sanmai/later", @@ -3606,16 +3624,16 @@ }, { "name": "sanmai/pipeline", - "version": "v6.2", + "version": "v6.3", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "1c14946cb089776fb024807f1e4f5a985db0ce3c" + "reference": "929b115ca58d62b6b2574702df1ebde4562c7c43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/1c14946cb089776fb024807f1e4f5a985db0ce3c", - "reference": "1c14946cb089776fb024807f1e4f5a985db0ce3c", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/929b115ca58d62b6b2574702df1ebde4562c7c43", + "reference": "929b115ca58d62b6b2574702df1ebde4562c7c43", "shasum": "" }, "require": { @@ -3659,7 +3677,7 @@ "description": "General-purpose collections pipeline", "support": { "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.2" + "source": "https://github.com/sanmai/pipeline/tree/v6.3" }, "funding": [ { @@ -3667,7 +3685,7 @@ "type": "github" } ], - "time": "2022-11-09T05:47:57+00:00" + "time": "2022-11-30T06:07:06+00:00" }, { "name": "sebastian/cli-parser", @@ -4755,16 +4773,16 @@ }, { "name": "symfony/config", - "version": "v6.1.3", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "a0645dc585d378b73c01115dd7ab9348f7d40c85" + "reference": "ebf27792246165a2a0b6b69ec9c620cac8c5a2f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/a0645dc585d378b73c01115dd7ab9348f7d40c85", - "reference": "a0645dc585d378b73c01115dd7ab9348f7d40c85", + "url": "https://api.github.com/repos/symfony/config/zipball/ebf27792246165a2a0b6b69ec9c620cac8c5a2f0", + "reference": "ebf27792246165a2a0b6b69ec9c620cac8c5a2f0", "shasum": "" }, "require": { @@ -4812,7 +4830,7 @@ "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/v6.1.3" + "source": "https://github.com/symfony/config/tree/v6.2.0" }, "funding": [ { @@ -4828,20 +4846,20 @@ "type": "tidelift" } ], - "time": "2022-07-20T15:00:40+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/console", - "version": "v6.1.7", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a1282bd0c096e0bdb8800b104177e2ce404d8815" + "reference": "75d4749d9620a8fa21a2d2847800a84b5c4e7682" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a1282bd0c096e0bdb8800b104177e2ce404d8815", - "reference": "a1282bd0c096e0bdb8800b104177e2ce404d8815", + "url": "https://api.github.com/repos/symfony/console/zipball/75d4749d9620a8fa21a2d2847800a84b5c4e7682", + "reference": "75d4749d9620a8fa21a2d2847800a84b5c4e7682", "shasum": "" }, "require": { @@ -4908,7 +4926,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.7" + "source": "https://github.com/symfony/console/tree/v6.2.0" }, "funding": [ { @@ -4924,7 +4942,7 @@ "type": "tidelift" } ], - "time": "2022-10-26T21:42:49+00:00" + "time": "2022-11-29T16:44:51+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4995,16 +5013,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347" + "reference": "9efb1618fabee89515fe031314e8ed5625f85a53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a0449a7ad7daa0f7c0acd508259f80544ab5a347", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9efb1618fabee89515fe031314e8ed5625f85a53", + "reference": "9efb1618fabee89515fe031314e8ed5625f85a53", "shasum": "" }, "require": { @@ -5058,7 +5076,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.1.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.0" }, "funding": [ { @@ -5074,7 +5092,7 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:51:07+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -5157,16 +5175,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.1.5", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "4d216a2beef096edf040a070117c39ca2abce307" + "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/4d216a2beef096edf040a070117c39ca2abce307", - "reference": "4d216a2beef096edf040a070117c39ca2abce307", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/50b2523c874605cf3d4acf7a9e2b30b6a440a016", + "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016", "shasum": "" }, "require": { @@ -5200,7 +5218,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.1.5" + "source": "https://github.com/symfony/filesystem/tree/v6.2.0" }, "funding": [ { @@ -5216,20 +5234,20 @@ "type": "tidelift" } ], - "time": "2022-09-21T20:29:40+00:00" + "time": "2022-11-20T13:01:27+00:00" }, { "name": "symfony/finder", - "version": "v6.1.3", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709" + "reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/39696bff2c2970b3779a5cac7bf9f0b88fc2b709", - "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709", + "url": "https://api.github.com/repos/symfony/finder/zipball/eb2355f69519e4ef33f1835bca4c935f5d42e570", + "reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570", "shasum": "" }, "require": { @@ -5264,7 +5282,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.1.3" + "source": "https://github.com/symfony/finder/tree/v6.2.0" }, "funding": [ { @@ -5280,20 +5298,20 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:42:06+00:00" + "time": "2022-10-09T08:55:40+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4" + "reference": "d28f02acde71ff75e957082cd36e973df395f626" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a3016f5442e28386ded73c43a32a5b68586dd1c4", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/d28f02acde71ff75e957082cd36e973df395f626", + "reference": "d28f02acde71ff75e957082cd36e973df395f626", "shasum": "" }, "require": { @@ -5331,7 +5349,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.1.0" + "source": "https://github.com/symfony/options-resolver/tree/v6.2.0" }, "funding": [ { @@ -5347,7 +5365,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5843,16 +5861,16 @@ }, { "name": "symfony/process", - "version": "v6.1.3", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292" + "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/a6506e99cfad7059b1ab5cab395854a0a0c21292", - "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292", + "url": "https://api.github.com/repos/symfony/process/zipball/ba6e55359f8f755fe996c58a81e00eaa67a35877", + "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877", "shasum": "" }, "require": { @@ -5884,7 +5902,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.1.3" + "source": "https://github.com/symfony/process/tree/v6.2.0" }, "funding": [ { @@ -5900,7 +5918,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T17:24:16+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/service-contracts", @@ -5989,7 +6007,7 @@ }, { "name": "symfony/stopwatch", - "version": "v6.1.5", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -6031,7 +6049,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.1.5" + "source": "https://github.com/symfony/stopwatch/tree/v6.2.0" }, "funding": [ { @@ -6051,16 +6069,16 @@ }, { "name": "symfony/string", - "version": "v6.1.7", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "823f143370880efcbdfa2dbca946b3358c4707e5" + "reference": "145702685e0d12f81d755c71127bfff7582fdd36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/823f143370880efcbdfa2dbca946b3358c4707e5", - "reference": "823f143370880efcbdfa2dbca946b3358c4707e5", + "url": "https://api.github.com/repos/symfony/string/zipball/145702685e0d12f81d755c71127bfff7582fdd36", + "reference": "145702685e0d12f81d755c71127bfff7582fdd36", "shasum": "" }, "require": { @@ -6076,6 +6094,7 @@ "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, @@ -6116,7 +6135,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.7" + "source": "https://github.com/symfony/string/tree/v6.2.0" }, "funding": [ { @@ -6132,20 +6151,20 @@ "type": "tidelift" } ], - "time": "2022-10-10T09:34:31+00:00" + "time": "2022-11-30T17:13:47+00:00" }, { "name": "symfony/yaml", - "version": "v6.1.6", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "66c6b0cf52b00f74614a2cf7ae7db08ea1095931" + "reference": "f2570f21bd4adc3589aa3133323273995109bae0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/66c6b0cf52b00f74614a2cf7ae7db08ea1095931", - "reference": "66c6b0cf52b00f74614a2cf7ae7db08ea1095931", + "url": "https://api.github.com/repos/symfony/yaml/zipball/f2570f21bd4adc3589aa3133323273995109bae0", + "reference": "f2570f21bd4adc3589aa3133323273995109bae0", "shasum": "" }, "require": { @@ -6190,7 +6209,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.1.6" + "source": "https://github.com/symfony/yaml/tree/v6.2.0" }, "funding": [ { @@ -6206,7 +6225,7 @@ "type": "tidelift" } ], - "time": "2022-10-07T08:04:03+00:00" + "time": "2022-11-25T19:00:27+00:00" }, { "name": "thecodingmachine/safe", @@ -6399,24 +6418,24 @@ }, { "name": "vimeo/psalm", - "version": "4.30.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" + "reference": "4defa177c89397c5e14737a80fe4896584130674" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/4defa177c89397c5e14737a80fe4896584130674", + "reference": "4defa177c89397c5e14737a80fe4896584130674", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", + "composer/package-versions-deprecated": "^1.10.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -6425,35 +6444,34 @@ "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", + "felixfbecker/advanced-json-rpc": "^3.1", + "felixfbecker/language-server-protocol": "^1.5.2", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25", - "webmozart/path-util": "^2.3" + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "sebastian/diff": "^4.0", + "symfony/console": "^4.1.6 || ^5.0 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.0", "ext-curl": "*", + "mockery/mockery": "^1.5", + "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpstan/phpdoc-parser": "1.2.* || 1.6.4", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" + "phpstan/phpdoc-parser": "^1.6", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.6", + "symfony/process": "^4.4 || ^5.0 || ^6.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -6469,17 +6487,14 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev", + "dev-master": "5.x-dev", + "dev-4.x": "4.x-dev", "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } }, "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], "psr-4": { "Psalm\\": "src/Psalm/" } @@ -6501,9 +6516,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.30.0" + "source": "https://github.com/vimeo/psalm/tree/5.1.0" }, - "time": "2022-11-06T20:37:08+00:00" + "time": "2022-12-02T01:23:35+00:00" }, { "name": "webmozart/assert", @@ -6611,62 +6626,13 @@ "source": "https://github.com/webmozarts/glob/tree/4.6.0" }, "time": "2022-05-24T19:45:58+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "php-standard-library/psalm-plugin": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/docs/component/filesystem.md b/docs/component/filesystem.md index 8ec8380f1..0c21458f8 100644 --- a/docs/component/filesystem.md +++ b/docs/component/filesystem.md @@ -28,7 +28,7 @@ - [create_temporary_file](./../../src/Psl/Filesystem/create_temporary_file.php#L26) - [delete_directory](./../../src/Psl/Filesystem/delete_directory.php#L23) - [delete_file](./../../src/Psl/Filesystem/delete_file.php#L21) -- [exists](./../../src/Psl/Filesystem/exists.php#L16) +- [exists](./../../src/Psl/Filesystem/exists.php#L14) - [file_size](./../../src/Psl/Filesystem/file_size.php#L22) - [get_access_time](./../../src/Psl/Filesystem/get_access_time.php#L20) - [get_basename](./../../src/Psl/Filesystem/get_basename.php#L23) diff --git a/src/Psl/Collection/MutableVector.php b/src/Psl/Collection/MutableVector.php index a4758afd6..facf41553 100644 --- a/src/Psl/Collection/MutableVector.php +++ b/src/Psl/Collection/MutableVector.php @@ -623,6 +623,8 @@ public function slice(int $start, ?int $length = null): MutableVector * `MutableVector` split into chunks of the given size. * * @psalm-mutation-free + * + * @psalm-suppress LessSpecificImplementedReturnType - I don't see how this one is less specific than its inherited. */ public function chunk(int $size): MutableVector { diff --git a/src/Psl/Collection/Vector.php b/src/Psl/Collection/Vector.php index ecf33ab09..5e596b63f 100644 --- a/src/Psl/Collection/Vector.php +++ b/src/Psl/Collection/Vector.php @@ -501,6 +501,8 @@ public function slice(int $start, ?int $length = null): Vector * into chunks of the given size. * * @psalm-mutation-free + * + * @psalm-suppress LessSpecificImplementedReturnType - I don't see how this one is less specific than its inherited. */ public function chunk(int $size): Vector { diff --git a/src/Psl/Filesystem/exists.php b/src/Psl/Filesystem/exists.php index ddaecef2c..d04767158 100644 --- a/src/Psl/Filesystem/exists.php +++ b/src/Psl/Filesystem/exists.php @@ -9,9 +9,7 @@ /** * Check whether $node exists. * - * @param string $node Path, absolute or relative to the current working directory. - * - * @psalm-assert-if-true non-empty-string $node + * @param non-empty-string $node Path, absolute or relative to the current working directory. */ function exists(string $node): bool { diff --git a/src/Psl/Hash/Context.php b/src/Psl/Hash/Context.php index 2ac225db5..5d755eb7f 100644 --- a/src/Psl/Hash/Context.php +++ b/src/Psl/Hash/Context.php @@ -72,6 +72,7 @@ public function update(string $data): Context $internal_context = hash_copy($this->internalContext); // @codeCoverageIgnoreStart + /** @psalm-suppress ImpureFunctionCall - it creates a copy of the context, so we can consider it pure! */ if (!hash_update($internal_context, $data)) { throw new Exception\RuntimeException('Unable to pump data into the active hashing context.'); } diff --git a/src/Psl/IO/Internal/ResourceHandle.php b/src/Psl/IO/Internal/ResourceHandle.php index b522be2ac..2b57334e7 100644 --- a/src/Psl/IO/Internal/ResourceHandle.php +++ b/src/Psl/IO/Internal/ResourceHandle.php @@ -75,6 +75,7 @@ class ResourceHandle implements IO\CloseSeekReadWriteStreamHandleInterface */ public function __construct(mixed $stream, bool $read, bool $write, bool $seek, private bool $close) { + /** @psalm-suppress RedundantConditionGivenDocblockType - The stream is always a resource, but we want to make sure it is a stream resource. */ $this->stream = Type\resource('stream')->assert($stream); /** @psalm-suppress UnusedFunctionCall */ diff --git a/src/Psl/Iter/Iterator.php b/src/Psl/Iter/Iterator.php index 4a34cb735..044202a22 100644 --- a/src/Psl/Iter/Iterator.php +++ b/src/Psl/Iter/Iterator.php @@ -72,6 +72,8 @@ public static function from(Closure $factory): Iterator /** * Create an iterator from an iterable. * + * @psalm-suppress DocblockTypeContradiction - Psalm gets lost on Generator, which is a perfectly valid iterable type. + * * @template Tsk * @template Tsv * diff --git a/src/Psl/Json/decode.php b/src/Psl/Json/decode.php index 1ed442568..416678af9 100644 --- a/src/Psl/Json/decode.php +++ b/src/Psl/Json/decode.php @@ -30,7 +30,7 @@ function decode(string $json, bool $assoc = true): mixed JSON_BIGINT_AS_STRING | JSON_THROW_ON_ERROR, ); } catch (JsonException $e) { - throw new Exception\DecodeException(Str\format('%s.', $e->getMessage()), (int)$e->getCode(), $e); + throw new Exception\DecodeException(Str\format('%s.', $e->getMessage()), $e->getCode(), $e); } return $value; diff --git a/src/Psl/Json/encode.php b/src/Psl/Json/encode.php index d2d823eea..a029ed716 100644 --- a/src/Psl/Json/encode.php +++ b/src/Psl/Json/encode.php @@ -36,7 +36,7 @@ function encode(mixed $value, bool $pretty = false, int $flags = 0): string try { $json = json_encode($value, $flags); } catch (JsonException $e) { - throw new Exception\EncodeException(Str\format('%s.', $e->getMessage()), (int)$e->getCode(), $e); + throw new Exception\EncodeException(Str\format('%s.', $e->getMessage()), $e->getCode(), $e); } return $json; diff --git a/src/Psl/Json/typed.php b/src/Psl/Json/typed.php index c292fc240..d1db92afb 100644 --- a/src/Psl/Json/typed.php +++ b/src/Psl/Json/typed.php @@ -22,6 +22,6 @@ function typed(string $json, Type\TypeInterface $type): mixed try { return $type->coerce(decode($json)); } catch (Type\Exception\CoercionException $e) { - throw new Exception\DecodeException($e->getMessage(), (int)$e->getCode(), $e); + throw new Exception\DecodeException($e->getMessage(), $e->getCode(), $e); } } diff --git a/src/Psl/Str/Byte/split.php b/src/Psl/Str/Byte/split.php index 013566ab9..44fdb5c90 100644 --- a/src/Psl/Str/Byte/split.php +++ b/src/Psl/Str/Byte/split.php @@ -30,7 +30,6 @@ function split(string $string, string $delimiter, ?int $limit = null): array return [$string]; } - /** @var positive-int $length */ $length = $limit - 1; $result = chunk(slice($string, 0, $length)); diff --git a/src/Psl/Str/split.php b/src/Psl/Str/split.php index 543965b2c..6c9eb14b2 100644 --- a/src/Psl/Str/split.php +++ b/src/Psl/Str/split.php @@ -30,7 +30,6 @@ function split(string $string, string $delimiter, ?int $limit = null, Encoding $ return [$string]; } - /** @var positive-int $length */ $length = $limit - 1; $result = chunk(slice($string, 0, $length, $encoding), 1, $encoding); diff --git a/tests/benchmark/Type/Asset/ExplicitStringableObject.php b/tests/benchmark/Type/Asset/ExplicitStringableObject.php index a1b63208e..c6ce42a5c 100644 --- a/tests/benchmark/Type/Asset/ExplicitStringableObject.php +++ b/tests/benchmark/Type/Asset/ExplicitStringableObject.php @@ -8,7 +8,7 @@ final class ExplicitStringableObject implements Stringable { - public function __toString() + public function __toString(): string { return '123'; } diff --git a/tests/benchmark/Type/Asset/ImplicitStringableObject.php b/tests/benchmark/Type/Asset/ImplicitStringableObject.php index 7d1e795b1..a304201a3 100644 --- a/tests/benchmark/Type/Asset/ImplicitStringableObject.php +++ b/tests/benchmark/Type/Asset/ImplicitStringableObject.php @@ -6,7 +6,7 @@ final class ImplicitStringableObject { - public function __toString() + public function __toString(): string { return '123'; } diff --git a/tests/static-analysis/Fun/pipe.php b/tests/static-analysis/Fun/pipe.php index 32268605d..a86e9a22d 100644 --- a/tests/static-analysis/Fun/pipe.php +++ b/tests/static-analysis/Fun/pipe.php @@ -6,38 +6,36 @@ use function Psl\Fun\pipe; -/** - * @psalm-suppress TooFewArguments, UnusedClosureParam - */ -function test_too_few_argument_count_issues(): void +function test_too_few_argument_dont_matter(): int { $stages = pipe( static fn (): int => 2, ); - $stages('hello'); + + return $stages('hello'); } /** - * @psalm-suppress TooManyArguments, UnusedClosureParam, InvalidArgument + * @psalm-suppress InvalidArgument, UnusedClosureParam */ -function test_too_many_argument_count_issues(): void +function test_too_many_argument_count_issues(): int { $stages = pipe( static fn (string $x, string $y): int => 2, ); - $stages('hello'); + return $stages('hello'); } /** - * @psalm-suppress UnusedClosureParam, InvalidArgument + * @psalm-suppress UnusedClosureParam */ -function test_variadic_and_default_params(): void +function test_variadic_and_default_params(): int { $stages = pipe( static fn (int $y, string $x = 'hello'): float => 1.2, static fn (float ...$items): int => 23 ); - $stages('hello'); + return $stages(123); } /** @@ -45,12 +43,13 @@ function test_variadic_and_default_params(): void * * @see https://github.com/vimeo/psalm/issues/7244 * - * @psalm-suppress InvalidScalarArgument + * @psalm-suppress InvalidArgument + * @psalm-suppress NoValue - Resolves into "\Closure(never): never" because of the issue linked above. */ -function test_empty_pipe(): void +function test_empty_pipe(): string { $stages = pipe(); - $stages('hello'); + return $stages('hello'); } /** @@ -66,27 +65,27 @@ function test_invalid_arguments(): void } /** - * @psalm-suppress UnusedClosureParam, InvalidArgument + * @psalm-suppress InvalidScalarArgument, UnusedClosureParam */ -function test_invalid_return_to_input_type(): void +function test_invalid_return_to_input_type(): float { $stages = pipe( static fn (string $x): int => 2, static fn (string $y): float => 1.2 ); - $stages('hello'); + return $stages('hello'); } /** * @psalm-suppress UnusedClosureParam, InvalidArgument */ -function test_invalid_input_type(): void +function test_invalid_input_type(): float { $stages = pipe( static fn (string $x): int => 2, static fn (int $y): float => 1.2 ); - $stages(143); + return $stages(143); } /** @@ -106,11 +105,11 @@ function test_output_type_is_known(): void /** * @psalm-suppress UnusedClosureParam */ -function test_currently_unparsed_input_types(): void +function test_first_class_callables(): int { $stages = pipe( $assignment = static fn (string $x): int => 2, (static fn (): int => 2)(...), ); - $stages('hello'); + return $stages('hello'); }