dep: package update
This commit is contained in:
+15
-1
@@ -3,13 +3,14 @@ var_representation_polyfill
|
||||
|
||||
[](https://github.com/TysonAndre/var_representation_polyfill/actions/workflows/main.yml?query=branch%3Amain)
|
||||
[](https://github.com/TysonAndre/var_representation_polyfill/blob/main/LICENSE)
|
||||
[](https://packagist.org/packages/TysonAndre/var_representation_polyfill)
|
||||
|
||||
[var_representation_polyfill](https://github.com/TysonAndre/var_representation_polyfill) is a polyfill for https://pecl.php.net/var_representation
|
||||
|
||||
This provides a polyfill for the function `var_representation(mixed $value, int $flags = 0): string`, which converts a
|
||||
variable to a string in a way that fixes the shortcomings of `var_export()`
|
||||
|
||||
See [var_representation](https://github.com/TysonAndre/var_representation) documentation for more details
|
||||
See [the var_representation PECL documentation](https://github.com/TysonAndre/var_representation) for more details
|
||||
|
||||
Installation
|
||||
------------
|
||||
@@ -28,9 +29,22 @@ php > echo var_representation(['a','b']);
|
||||
'a',
|
||||
'b',
|
||||
]
|
||||
|
||||
// can dump everything on one line.
|
||||
php > echo var_representation(['a', 'b', 'c'], VAR_REPRESENTATION_SINGLE_LINE);
|
||||
['a', 'b', 'c']
|
||||
|
||||
php > echo var_representation("uses double quotes: \$\"'\\\n");
|
||||
"uses double quotes: \$\"'\\\n"
|
||||
|
||||
// Can disable the escaping of control characters as of polyfill version 0.1.0
|
||||
// (e.g. if the return value needs to be escaped again)
|
||||
php > echo var_representation("has\nnewlines", VAR_REPRESENTATION_UNESCAPED);
|
||||
'has
|
||||
newlines'
|
||||
php > echo json_encode("uses single quotes:\0\r\n\$\"'\\");
|
||||
"uses single quotes:\u0000\r\n$\"'\\"
|
||||
php > echo json_encode(var_representation("uses single quotes:\0\r\n\$\"'\\",
|
||||
VAR_REPRESENTATION_UNESCAPED));
|
||||
"'uses single quotes:\u0000\r\n$\"\\'\\\\'"
|
||||
```
|
||||
|
||||
@@ -6,6 +6,7 @@ RUN apt-get update && \
|
||||
apt-get install -y zlib1g-dev libzip-dev && \
|
||||
docker-php-ext-configure zip && \
|
||||
docker-php-ext-install -j$(nproc) zip
|
||||
# Install php-ast to analyze this project with phan
|
||||
RUN pecl install ast && \
|
||||
docker-php-ext-enable ast
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ fi
|
||||
set -xeu
|
||||
PHP_VERSION=$1
|
||||
|
||||
DOCKER_IMAGE=igbinary-$PHP_VERSION-test-runner
|
||||
DOCKER_IMAGE=var_representation-$PHP_VERSION-test-runner
|
||||
docker build --build-arg="PHP_VERSION=$PHP_VERSION" --tag="$DOCKER_IMAGE" -f ci/Dockerfile .
|
||||
docker run --rm $DOCKER_IMAGE vendor/bin/phpunit
|
||||
docker run --rm $DOCKER_IMAGE vendor/bin/phan
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tysonandre/var_representation_polyfill",
|
||||
"description": "Polyfill for var_representation",
|
||||
"description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export",
|
||||
"keywords": ["var_export", "var_representation"],
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
@@ -23,6 +23,9 @@
|
||||
"phan/phan": "^4.0",
|
||||
"phpunit/phpunit": "^8.5.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-var_representation": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {"VarRepresentation\\": "src/VarRepresentation"},
|
||||
"files": ["src/var_representation.php"]
|
||||
|
||||
+105
-104
@@ -90,21 +90,21 @@
|
||||
},
|
||||
{
|
||||
"name": "composer/xdebug-handler",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/xdebug-handler.git",
|
||||
"reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496"
|
||||
"reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/964adcdd3a28bf9ed5d9ac6450064e0d71ed7496",
|
||||
"reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496",
|
||||
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339",
|
||||
"reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.3.2 || ^7.0 || ^8.0",
|
||||
"psr/log": "^1.0"
|
||||
"psr/log": "^1 || ^2 || ^3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.55",
|
||||
@@ -134,7 +134,7 @@
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.org/composer",
|
||||
"issues": "https://github.com/composer/xdebug-handler/issues",
|
||||
"source": "https://github.com/composer/xdebug-handler/tree/2.0.1"
|
||||
"source": "https://github.com/composer/xdebug-handler/tree/2.0.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -150,7 +150,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-05-05T19:37:51+00:00"
|
||||
"time": "2021-07-31T17:03:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
@@ -268,23 +268,23 @@
|
||||
},
|
||||
{
|
||||
"name": "microsoft/tolerant-php-parser",
|
||||
"version": "v0.0.23",
|
||||
"version": "v0.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/tolerant-php-parser.git",
|
||||
"reference": "1d76657e3271754515ace52501d3e427eca42ad0"
|
||||
"reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/1d76657e3271754515ace52501d3e427eca42ad0",
|
||||
"reference": "1d76657e3271754515ace52501d3e427eca42ad0",
|
||||
"url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/6a965617cf484355048ac6d2d3de7b6ec93abb16",
|
||||
"reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0"
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.4"
|
||||
"phpunit/phpunit": "^8.5.15"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -307,9 +307,9 @@
|
||||
"description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios",
|
||||
"support": {
|
||||
"issues": "https://github.com/microsoft/tolerant-php-parser/issues",
|
||||
"source": "https://github.com/microsoft/tolerant-php-parser/tree/v0.0.23"
|
||||
"source": "https://github.com/microsoft/tolerant-php-parser/tree/v0.1.1"
|
||||
},
|
||||
"time": "2020-09-13T17:29:12+00:00"
|
||||
"time": "2021-07-16T21:28:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
@@ -371,16 +371,16 @@
|
||||
},
|
||||
{
|
||||
"name": "netresearch/jsonmapper",
|
||||
"version": "v3.1.1",
|
||||
"version": "v4.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cweiske/jsonmapper.git",
|
||||
"reference": "ba09f0e456d4f00cef84e012da5715625594407c"
|
||||
"reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/ba09f0e456d4f00cef84e012da5715625594407c",
|
||||
"reference": "ba09f0e456d4f00cef84e012da5715625594407c",
|
||||
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d",
|
||||
"reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -388,10 +388,10 @@
|
||||
"ext-pcre": "*",
|
||||
"ext-reflection": "*",
|
||||
"ext-spl": "*",
|
||||
"php": ">=5.6"
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0",
|
||||
"phpunit/phpunit": "~7.5 || ~8.0 || ~9.0",
|
||||
"squizlabs/php_codesniffer": "~3.5"
|
||||
},
|
||||
"type": "library",
|
||||
@@ -416,22 +416,22 @@
|
||||
"support": {
|
||||
"email": "cweiske@cweiske.de",
|
||||
"issues": "https://github.com/cweiske/jsonmapper/issues",
|
||||
"source": "https://github.com/cweiske/jsonmapper/tree/v3.1.1"
|
||||
"source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0"
|
||||
},
|
||||
"time": "2020-11-02T19:19:54+00:00"
|
||||
"time": "2020-12-01T19:48:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phan/phan",
|
||||
"version": "4.0.6",
|
||||
"version": "4.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phan/phan.git",
|
||||
"reference": "4caaa97195dcea549021cb773a5dc30bb46d1fab"
|
||||
"reference": "71f0a341fd9ed3bf88d57e3bc380f3e941a5df14"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phan/phan/zipball/4caaa97195dcea549021cb773a5dc30bb46d1fab",
|
||||
"reference": "4caaa97195dcea549021cb773a5dc30bb46d1fab",
|
||||
"url": "https://api.github.com/repos/phan/phan/zipball/71f0a341fd9ed3bf88d57e3bc380f3e941a5df14",
|
||||
"reference": "71f0a341fd9ed3bf88d57e3bc380f3e941a5df14",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -441,8 +441,8 @@
|
||||
"ext-json": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"felixfbecker/advanced-json-rpc": "^3.0.4",
|
||||
"microsoft/tolerant-php-parser": "0.0.23",
|
||||
"netresearch/jsonmapper": "^1.6.0|^2.0|^3.0",
|
||||
"microsoft/tolerant-php-parser": "0.1.1",
|
||||
"netresearch/jsonmapper": "^1.6.0|^2.0|^3.0|^4.0",
|
||||
"php": "^7.2.0|^8.0.0",
|
||||
"sabre/event": "^5.0.3",
|
||||
"symfony/console": "^3.2|^4.0|^5.0",
|
||||
@@ -493,22 +493,22 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/phan/phan/issues",
|
||||
"source": "https://github.com/phan/phan/tree/4.0.6"
|
||||
"source": "https://github.com/phan/phan/tree/4.1.0"
|
||||
},
|
||||
"time": "2021-05-19T23:27:16+00:00"
|
||||
"time": "2021-08-10T14:01:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phar-io/manifest",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phar-io/manifest.git",
|
||||
"reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133"
|
||||
"reference": "97803eca37d319dfa7826cc2437fc020857acb53"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133",
|
||||
"reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133",
|
||||
"url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
|
||||
"reference": "97803eca37d319dfa7826cc2437fc020857acb53",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -553,9 +553,9 @@
|
||||
"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/master"
|
||||
"source": "https://github.com/phar-io/manifest/tree/2.0.3"
|
||||
},
|
||||
"time": "2020-06-27T14:33:11+00:00"
|
||||
"time": "2021-07-20T11:28:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phar-io/version",
|
||||
@@ -835,16 +835,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "7.0.14",
|
||||
"version": "7.0.15",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "bb7c9a210c72e4709cdde67f8b7362f672f2225c"
|
||||
"reference": "819f92bba8b001d4363065928088de22f25a3a48"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bb7c9a210c72e4709cdde67f8b7362f672f2225c",
|
||||
"reference": "bb7c9a210c72e4709cdde67f8b7362f672f2225c",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48",
|
||||
"reference": "819f92bba8b001d4363065928088de22f25a3a48",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -853,7 +853,7 @@
|
||||
"php": ">=7.2",
|
||||
"phpunit/php-file-iterator": "^2.0.2",
|
||||
"phpunit/php-text-template": "^1.2.1",
|
||||
"phpunit/php-token-stream": "^3.1.1 || ^4.0",
|
||||
"phpunit/php-token-stream": "^3.1.3 || ^4.0",
|
||||
"sebastian/code-unit-reverse-lookup": "^1.0.1",
|
||||
"sebastian/environment": "^4.2.2",
|
||||
"sebastian/version": "^2.0.1",
|
||||
@@ -896,7 +896,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.14"
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -904,20 +904,20 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-12-02T13:39:03+00:00"
|
||||
"time": "2021-07-26T12:20:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
"version": "2.0.3",
|
||||
"version": "2.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
|
||||
"reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357"
|
||||
"reference": "28af674ff175d0768a5a978e6de83f697d4a7f05"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4b49fb70f067272b659ef0174ff9ca40fdaa6357",
|
||||
"reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/28af674ff175d0768a5a978e6de83f697d4a7f05",
|
||||
"reference": "28af674ff175d0768a5a978e6de83f697d4a7f05",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -956,7 +956,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.3"
|
||||
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -964,7 +964,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-11-30T08:25:21+00:00"
|
||||
"time": "2021-07-19T06:46:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-text-template",
|
||||
@@ -1072,16 +1072,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-token-stream",
|
||||
"version": "3.1.2",
|
||||
"version": "3.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
||||
"reference": "472b687829041c24b25f475e14c2f38a09edf1c2"
|
||||
"reference": "9c1da83261628cb24b6a6df371b6e312b3954768"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/472b687829041c24b25f475e14c2f38a09edf1c2",
|
||||
"reference": "472b687829041c24b25f475e14c2f38a09edf1c2",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768",
|
||||
"reference": "9c1da83261628cb24b6a6df371b6e312b3954768",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1119,7 +1119,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.2"
|
||||
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1128,20 +1128,20 @@
|
||||
}
|
||||
],
|
||||
"abandoned": true,
|
||||
"time": "2020-11-30T08:38:46+00:00"
|
||||
"time": "2021-07-26T12:15:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "8.5.17",
|
||||
"version": "8.5.19",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "79067856d85421c56d413bd238d4e2cd6b0e54da"
|
||||
"reference": "496281b64ec781856ed0a583483b5923b4033722"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/79067856d85421c56d413bd238d4e2cd6b0e54da",
|
||||
"reference": "79067856d85421c56d413bd238d4e2cd6b0e54da",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/496281b64ec781856ed0a583483b5923b4033722",
|
||||
"reference": "496281b64ec781856ed0a583483b5923b4033722",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1153,12 +1153,12 @@
|
||||
"ext-xml": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"myclabs/deep-copy": "^1.10.0",
|
||||
"phar-io/manifest": "^2.0.1",
|
||||
"phar-io/manifest": "^2.0.3",
|
||||
"phar-io/version": "^3.0.2",
|
||||
"php": ">=7.2",
|
||||
"phpspec/prophecy": "^1.10.3",
|
||||
"phpunit/php-code-coverage": "^7.0.12",
|
||||
"phpunit/php-file-iterator": "^2.0.2",
|
||||
"phpunit/php-file-iterator": "^2.0.4",
|
||||
"phpunit/php-text-template": "^1.2.1",
|
||||
"phpunit/php-timer": "^2.1.2",
|
||||
"sebastian/comparator": "^3.0.2",
|
||||
@@ -1213,7 +1213,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.17"
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.19"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1225,7 +1225,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-06-23T05:12:43+00:00"
|
||||
"time": "2021-07-31T15:15:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
@@ -2122,16 +2122,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v5.3.2",
|
||||
"version": "v5.3.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1"
|
||||
"reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
|
||||
"reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2",
|
||||
"reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2139,11 +2139,12 @@
|
||||
"symfony/deprecation-contracts": "^2.1",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php73": "^1.8",
|
||||
"symfony/polyfill-php80": "^1.15",
|
||||
"symfony/polyfill-php80": "^1.16",
|
||||
"symfony/service-contracts": "^1.1|^2",
|
||||
"symfony/string": "^5.1"
|
||||
},
|
||||
"conflict": {
|
||||
"psr/log": ">=3",
|
||||
"symfony/dependency-injection": "<4.4",
|
||||
"symfony/dotenv": "<5.1",
|
||||
"symfony/event-dispatcher": "<4.4",
|
||||
@@ -2151,10 +2152,10 @@
|
||||
"symfony/process": "<4.4"
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0"
|
||||
"psr/log-implementation": "1.0|2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"psr/log": "^1|^2",
|
||||
"symfony/config": "^4.4|^5.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0",
|
||||
"symfony/event-dispatcher": "^4.4|^5.0",
|
||||
@@ -2200,7 +2201,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v5.3.2"
|
||||
"source": "https://github.com/symfony/console/tree/v5.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2216,7 +2217,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-06-12T09:42:48+00:00"
|
||||
"time": "2021-07-27T19:10:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
@@ -2366,16 +2367,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-grapheme",
|
||||
"version": "v1.23.0",
|
||||
"version": "v1.23.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
|
||||
"reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab"
|
||||
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/24b72c6baa32c746a4d0840147c9715e42bb68ab",
|
||||
"reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535",
|
||||
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2427,7 +2428,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.0"
|
||||
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2443,7 +2444,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-05-27T09:17:38+00:00"
|
||||
"time": "2021-05-27T12:26:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-normalizer",
|
||||
@@ -2531,16 +2532,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.23.0",
|
||||
"version": "v1.23.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1"
|
||||
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1",
|
||||
"reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6",
|
||||
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2591,7 +2592,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2607,7 +2608,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-05-27T09:27:20+00:00"
|
||||
"time": "2021-05-27T12:26:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php73",
|
||||
@@ -2690,16 +2691,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.23.0",
|
||||
"version": "v1.23.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0"
|
||||
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0",
|
||||
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be",
|
||||
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2753,7 +2754,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0"
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2769,7 +2770,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-02-19T12:13:01+00:00"
|
||||
"time": "2021-07-28T13:41:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
@@ -2852,16 +2853,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
"version": "v5.3.2",
|
||||
"version": "v5.3.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/string.git",
|
||||
"reference": "0732e97e41c0a590f77e231afc16a327375d50b0"
|
||||
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/0732e97e41c0a590f77e231afc16a327375d50b0",
|
||||
"reference": "0732e97e41c0a590f77e231afc16a327375d50b0",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
|
||||
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2915,7 +2916,7 @@
|
||||
"utf8"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/string/tree/v5.3.2"
|
||||
"source": "https://github.com/symfony/string/tree/v5.3.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2931,20 +2932,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-06-06T09:51:56+00:00"
|
||||
"time": "2021-06-27T11:44:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "theseer/tokenizer",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/theseer/tokenizer.git",
|
||||
"reference": "75a63c33a8577608444246075ea0af0d052e452a"
|
||||
"reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a",
|
||||
"reference": "75a63c33a8577608444246075ea0af0d052e452a",
|
||||
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
|
||||
"reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2973,7 +2974,7 @@
|
||||
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
|
||||
"support": {
|
||||
"issues": "https://github.com/theseer/tokenizer/issues",
|
||||
"source": "https://github.com/theseer/tokenizer/tree/master"
|
||||
"source": "https://github.com/theseer/tokenizer/tree/1.2.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2981,7 +2982,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-12T23:59:07+00:00"
|
||||
"time": "2021-07-28T10:34:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
@@ -3055,5 +3056,5 @@
|
||||
"platform-overrides": {
|
||||
"php": "7.2.24"
|
||||
},
|
||||
"plugin-api-version": "2.0.0"
|
||||
"plugin-api-version": "2.1.0"
|
||||
}
|
||||
|
||||
+26
-4
@@ -23,6 +23,8 @@ class Encoder
|
||||
protected $raw;
|
||||
/** @var int the current offset */
|
||||
protected $i = 1;
|
||||
/** @var bool whether the flags for the most recent call are VAR_REPRESENTATION_UNESCAPED */
|
||||
protected $unescaped = false;
|
||||
|
||||
protected function __construct(string $raw)
|
||||
{
|
||||
@@ -68,6 +70,7 @@ class Encoder
|
||||
*/
|
||||
protected function encode(int $flags): string
|
||||
{
|
||||
$this->unescaped = ($flags & \VAR_REPRESENTATION_UNESCAPED) !== 0;
|
||||
$result = $this->encodeValue();
|
||||
if ($this->i !== \count($this->tokens) + 1) {
|
||||
throw new RuntimeException("Failed to read token #$this->i of $this->raw: " . \var_export($this->tokens[$this->i] ?? null, true));
|
||||
@@ -145,6 +148,10 @@ class Encoder
|
||||
}
|
||||
$values[] = $this->encodeArray();
|
||||
break;
|
||||
case \T_OBJECT_CAST:
|
||||
$values[] = $token[1];
|
||||
$values[] = ' ';
|
||||
break;
|
||||
case \T_STRING:
|
||||
switch ($token[1]) {
|
||||
case 'NULL';
|
||||
@@ -204,11 +211,16 @@ class Encoder
|
||||
}
|
||||
$unescaped_str .= self::unescapeStringRepresentation($token[1]);
|
||||
}
|
||||
if (!\preg_match('/[\\x00-\\x1f\\x7f-\xff]/', $unescaped_str)) {
|
||||
if (!\preg_match('/[\\x00-\\x1f\\x7f]/', $unescaped_str)) {
|
||||
// This does not have '"\0"', so it is already a single quoted string
|
||||
return new Group([$prefix]);
|
||||
}
|
||||
return new Group([self::encodeRawStringDoubleQuoted($unescaped_str)]);
|
||||
if ($this->unescaped) {
|
||||
$repr = self::encodeRawStringUnescapedSingleQuoted($unescaped_str);
|
||||
} else {
|
||||
$repr = self::encodeRawStringDoubleQuoted($unescaped_str);
|
||||
}
|
||||
return new Group([$repr]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +230,7 @@ class Encoder
|
||||
*/
|
||||
public static function encodeRawString(string $raw): string
|
||||
{
|
||||
if (!\preg_match('/[\\x00-\\x1f\\x7f-\xff]/', $raw)) {
|
||||
if (!\preg_match('/[\\x00-\\x1f\\x7f]/', $raw)) {
|
||||
// This does not have '"\0"', so var_export will return a single quoted string
|
||||
return \var_export($raw, true);
|
||||
}
|
||||
@@ -232,7 +244,7 @@ class Encoder
|
||||
public static function encodeRawStringDoubleQuoted(string $raw): string
|
||||
{
|
||||
return '"' . \preg_replace_callback(
|
||||
'/[\\x00-\\x1f\\x7f-\xff\\\\"$]/',
|
||||
'/[\\x00-\\x1f\\x7f\\\\"$]/',
|
||||
/** @param array{0:string} $match */
|
||||
static function (array $match): string {
|
||||
$char = $match[0];
|
||||
@@ -242,6 +254,16 @@ class Encoder
|
||||
) . '"';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the representation of $raw in an unescaped single quoted string
|
||||
* (only escaping \\ and \', not escaping other control characters)
|
||||
* @api
|
||||
*/
|
||||
public static function encodeRawStringUnescapedSingleQuoted(string $raw): string
|
||||
{
|
||||
return "'" . \preg_replace('/[\'\\\\]/', '\\\0', $raw) . "'";
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode an array
|
||||
*/
|
||||
|
||||
+2
-2
@@ -54,8 +54,8 @@ class Array_ extends Node
|
||||
}
|
||||
$representation = "[\n";
|
||||
foreach ($parts as $part) {
|
||||
$representation .= \str_repeat(' ', $depth + 1) . $part->toIndentedString($depth + 1) . ",\n";
|
||||
$representation .= \str_repeat(' ', $depth + 1) . $part->toIndentedString($depth + 1) . ",\n";
|
||||
}
|
||||
return $representation . \str_repeat(' ', $depth) . "]";
|
||||
return $representation . \str_repeat(' ', $depth) . "]";
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ class Object_ extends Node
|
||||
public function __construct(string $prefix, Array_ $array, string $suffix)
|
||||
{
|
||||
if ($prefix === 'stdClass::__set_state(') {
|
||||
$this->prefix = '(object)';
|
||||
$this->prefix = '(object) ';
|
||||
$this->suffix = '';
|
||||
} else {
|
||||
$this->prefix = '\\' . $prefix;
|
||||
@@ -33,7 +33,7 @@ class Object_ extends Node
|
||||
public function __toString(): string
|
||||
{
|
||||
if ($this->prefix === 'stdClass::__set_state(') {
|
||||
return '(object)' . $this->array;
|
||||
return '(object) ' . $this->array;
|
||||
}
|
||||
return $this->prefix . $this->array->__toString() . $this->suffix;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,8 @@ if (!function_exists('var_representation')) {
|
||||
* Convert a variable to a string in a way that fixes the shortcomings of `var_export()`.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param int $flags bitmask of flags (VAR_REPRESENTATION_SINGLE_LINE)
|
||||
* @param int $flags bitmask of flags (VAR_REPRESENTATION_SINGLE_LINE, VAR_REPRESENTATION_UNESCAPED)
|
||||
* @suppress PhanRedefineFunctionInternal this is a polyfill
|
||||
*/
|
||||
function var_representation($value, int $flags = 0): string
|
||||
{
|
||||
@@ -43,3 +44,6 @@ if (!function_exists('var_representation')) {
|
||||
if (!defined('VAR_REPRESENTATION_SINGLE_LINE')) {
|
||||
define('VAR_REPRESENTATION_SINGLE_LINE', 1);
|
||||
}
|
||||
if (!defined('VAR_REPRESENTATION_UNESCAPED')) {
|
||||
define('VAR_REPRESENTATION_UNESCAPED', 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user