diff --git a/composer.json b/composer.json index fb317448bcfcddc9a8cd59a3dfd056cf688eee9f..c96c9d6433adbdd0906853d5f156497e95267184 100644 --- a/composer.json +++ b/composer.json @@ -98,7 +98,7 @@ "drupal/bootstrap": "^3.23", "drupal/cache_control_override": "^1.0@alpha", "drupal/ckeditor_indentblock": "1.0.0-beta2", - "drupal/config_direct_save": "1.0", + "drupal/config_direct_save": "2.1", "drupal/config_ignore": "2.3", "drupal/config_installer": "1.8", "drupal/config_update": "1.5", diff --git a/composer.lock b/composer.lock index 7c65989b04c38dddcb843f21ecb0d15e93ebb644..a6985a137e44052139adf9b1aff96a55edb86fa2 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": "f4b989bb19512480e2bad0f097a3981c", + "content-hash": "88440fa5742b9176f965c092257f399e", "packages": [ { "name": "alchemy/zippy", @@ -2729,26 +2729,26 @@ }, { "name": "drupal/config_direct_save", - "version": "1.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/config_direct_save.git", - "reference": "8.x-1.0" + "reference": "8.x-2.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/config_direct_save-8.x-1.0.zip", - "reference": "8.x-1.0", - "shasum": "dae776d96310aa01aa6e3c536821a1b496ffae1f" + "url": "https://ftp.drupal.org/files/projects/config_direct_save-8.x-2.1.zip", + "reference": "8.x-2.1", + "shasum": "24a3668db87b1bf001b038614dc3865d2ec5e374" }, "require": { - "drupal/core": "~8.0" + "drupal/core": "^8 || ^9" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.0", - "datestamp": "1476108239", + "version": "8.x-2.1", + "datestamp": "1618700636", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -14221,6 +14221,89 @@ ], "time": "2020-05-12T16:47:27+00:00" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "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.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, { "name": "symfony/polyfill-util", "version": "v1.17.0", @@ -14804,34 +14887,42 @@ }, { "name": "symfony/var-dumper", - "version": "v3.4.47", + "version": "v4.4.21", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "0719f6cf4633a38b2c1585140998579ce23b4b7d" + "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0719f6cf4633a38b2c1585140998579ce23b4b7d", - "reference": "0719f6cf4633a38b2c1585140998579ce23b4b7d", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0da0e174f728996f5d5072d6a9f0a42259dbc806", + "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", + "symfony/polyfill-php80": "^1.15" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" }, "require-dev": { "ext-iconv": "*", - "twig/twig": "~1.34|~2.4" + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.43|^2.13|^3.0.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", "ext-intl": "To show region name in time zone dump", - "ext-symfony_debug": "" + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, + "bin": [ + "Resources/bin/var-dump-server" + ], "type": "library", "autoload": { "files": [ @@ -14858,14 +14949,14 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony mechanism for exploring and dumping PHP variables", + "description": "Provides mechanisms for walking through any arbitrary PHP variable", "homepage": "https://symfony.com", "keywords": [ "debug", "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v3.4.47" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.21" }, "funding": [ { @@ -14881,7 +14972,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2021-03-27T19:49:03+00:00" }, { "name": "symfony/yaml", diff --git a/vendor/bin/var-dump-server b/vendor/bin/var-dump-server new file mode 120000 index 0000000000000000000000000000000000000000..6bd4e93db2ace7d78cb0e039b1aa793b31331a3f --- /dev/null +++ b/vendor/bin/var-dump-server @@ -0,0 +1 @@ +../symfony/var-dumper/Resources/bin/var-dump-server \ No newline at end of file diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index 4fa1b324abc3222b03d5df3de16c9377a475e66a..7a345d035f296c659e7453c796692c8c7ca5c0b9 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -30,7 +30,7 @@ class InstalledVersions 'aliases' => array ( ), - 'reference' => '95c9013593fdd0fdd7afdcaa3e25f1200a89509c', + 'reference' => '325400378ff6eb275598d7918db9b563266840a6', 'name' => 'osu-asc-webservices/d8-upstream', ), 'versions' => @@ -573,12 +573,12 @@ class InstalledVersions ), 'drupal/config_direct_save' => array ( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', + 'pretty_version' => '2.1.0', + 'version' => '2.1.0.0', 'aliases' => array ( ), - 'reference' => '8.x-1.0', + 'reference' => '8.x-2.1', ), 'drupal/config_filter' => array ( @@ -2305,7 +2305,7 @@ class InstalledVersions 'aliases' => array ( ), - 'reference' => '95c9013593fdd0fdd7afdcaa3e25f1200a89509c', + 'reference' => '325400378ff6eb275598d7918db9b563266840a6', ), 'pantheon-systems/quicksilver-pushback' => array ( @@ -2962,6 +2962,15 @@ class InstalledVersions ), 'reference' => 'f048e612a3905f34931127360bdd2def19a5e582', ), + 'symfony/polyfill-php80' => + array ( + 'pretty_version' => 'v1.22.1', + 'version' => '1.22.1.0', + 'aliases' => + array ( + ), + 'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91', + ), 'symfony/polyfill-util' => array ( 'pretty_version' => 'v1.17.0', @@ -3027,12 +3036,12 @@ class InstalledVersions ), 'symfony/var-dumper' => array ( - 'pretty_version' => 'v3.4.47', - 'version' => '3.4.47.0', + 'pretty_version' => 'v4.4.21', + 'version' => '4.4.21.0', 'aliases' => array ( ), - 'reference' => '0719f6cf4633a38b2c1585140998579ce23b4b7d', + 'reference' => '0da0e174f728996f5d5072d6a9f0a42259dbc806', ), 'symfony/yaml' => array ( diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 2bf2a1218769a95e2a176255e29d8c6bc70fb16f..7118bb3eb743149fff9936097ba4cfd8a5da93dc 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -90,6 +90,7 @@ 'Asm89\\Stack\\Cors' => $vendorDir . '/asm89/stack-cors/src/Asm89/Stack/Cors.php', 'Asm89\\Stack\\CorsService' => $vendorDir . '/asm89/stack-cors/src/Asm89/Stack/CorsService.php', 'AssertionError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php', + 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Basho\\Riak' => $vendorDir . '/phpfastcache/riak-client/src/Riak.php', 'Basho\\Riak\\Api' => $vendorDir . '/phpfastcache/riak-client/src/Riak/Api.php', 'Basho\\Riak\\ApiInterface' => $vendorDir . '/phpfastcache/riak-client/src/Riak/ApiInterface.php', @@ -4530,6 +4531,7 @@ 'Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion\\ShellPathCompletion' => $vendorDir . '/stecman/symfony-console-completion/src/Completion/ShellPathCompletion.php', 'Stecman\\Component\\Symfony\\Console\\BashCompletion\\EnvironmentCompletionContext' => $vendorDir . '/stecman/symfony-console-completion/src/EnvironmentCompletionContext.php', 'Stecman\\Component\\Symfony\\Console\\BashCompletion\\HookFactory' => $vendorDir . '/stecman/symfony-console-completion/src/HookFactory.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'Symfony\\Bridge\\PsrHttpMessage\\Factory\\DiactorosFactory' => $vendorDir . '/symfony/psr-http-message-bridge/Factory/DiactorosFactory.php', 'Symfony\\Bridge\\PsrHttpMessage\\Factory\\HttpFoundationFactory' => $vendorDir . '/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php', 'Symfony\\Bridge\\PsrHttpMessage\\Factory\\PsrHttpFactory' => $vendorDir . '/symfony/psr-http-message-bridge/Factory/PsrHttpFactory.php', @@ -5601,13 +5603,20 @@ 'Symfony\\Component\\VarDumper\\Caster\\DOMCaster' => $vendorDir . '/symfony/var-dumper/Caster/DOMCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\DateCaster' => $vendorDir . '/symfony/var-dumper/Caster/DateCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster' => $vendorDir . '/symfony/var-dumper/Caster/DoctrineCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\DsCaster' => $vendorDir . '/symfony/var-dumper/Caster/DsCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\DsPairStub' => $vendorDir . '/symfony/var-dumper/Caster/DsPairStub.php', 'Symfony\\Component\\VarDumper\\Caster\\EnumStub' => $vendorDir . '/symfony/var-dumper/Caster/EnumStub.php', 'Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster' => $vendorDir . '/symfony/var-dumper/Caster/ExceptionCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\FrameStub' => $vendorDir . '/symfony/var-dumper/Caster/FrameStub.php', + 'Symfony\\Component\\VarDumper\\Caster\\GmpCaster' => $vendorDir . '/symfony/var-dumper/Caster/GmpCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\ImagineCaster' => $vendorDir . '/symfony/var-dumper/Caster/ImagineCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\ImgStub' => $vendorDir . '/symfony/var-dumper/Caster/ImgStub.php', + 'Symfony\\Component\\VarDumper\\Caster\\IntlCaster' => $vendorDir . '/symfony/var-dumper/Caster/IntlCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\LinkStub' => $vendorDir . '/symfony/var-dumper/Caster/LinkStub.php', - 'Symfony\\Component\\VarDumper\\Caster\\MongoCaster' => $vendorDir . '/symfony/var-dumper/Caster/MongoCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\MemcachedCaster' => $vendorDir . '/symfony/var-dumper/Caster/MemcachedCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\PdoCaster' => $vendorDir . '/symfony/var-dumper/Caster/PdoCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster' => $vendorDir . '/symfony/var-dumper/Caster/PgSqlCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\ProxyManagerCaster' => $vendorDir . '/symfony/var-dumper/Caster/ProxyManagerCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\RedisCaster' => $vendorDir . '/symfony/var-dumper/Caster/RedisCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster' => $vendorDir . '/symfony/var-dumper/Caster/ReflectionCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\ResourceCaster' => $vendorDir . '/symfony/var-dumper/Caster/ResourceCaster.php', @@ -5615,6 +5624,7 @@ 'Symfony\\Component\\VarDumper\\Caster\\StubCaster' => $vendorDir . '/symfony/var-dumper/Caster/StubCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster' => $vendorDir . '/symfony/var-dumper/Caster/SymfonyCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\TraceStub' => $vendorDir . '/symfony/var-dumper/Caster/TraceStub.php', + 'Symfony\\Component\\VarDumper\\Caster\\UuidCaster' => $vendorDir . '/symfony/var-dumper/Caster/UuidCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\XmlReaderCaster' => $vendorDir . '/symfony/var-dumper/Caster/XmlReaderCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster' => $vendorDir . '/symfony/var-dumper/Caster/XmlResourceCaster.php', 'Symfony\\Component\\VarDumper\\Cloner\\AbstractCloner' => $vendorDir . '/symfony/var-dumper/Cloner/AbstractCloner.php', @@ -5624,11 +5634,23 @@ 'Symfony\\Component\\VarDumper\\Cloner\\DumperInterface' => $vendorDir . '/symfony/var-dumper/Cloner/DumperInterface.php', 'Symfony\\Component\\VarDumper\\Cloner\\Stub' => $vendorDir . '/symfony/var-dumper/Cloner/Stub.php', 'Symfony\\Component\\VarDumper\\Cloner\\VarCloner' => $vendorDir . '/symfony/var-dumper/Cloner/VarCloner.php', + 'Symfony\\Component\\VarDumper\\Command\\Descriptor\\CliDescriptor' => $vendorDir . '/symfony/var-dumper/Command/Descriptor/CliDescriptor.php', + 'Symfony\\Component\\VarDumper\\Command\\Descriptor\\DumpDescriptorInterface' => $vendorDir . '/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php', + 'Symfony\\Component\\VarDumper\\Command\\Descriptor\\HtmlDescriptor' => $vendorDir . '/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php', + 'Symfony\\Component\\VarDumper\\Command\\ServerDumpCommand' => $vendorDir . '/symfony/var-dumper/Command/ServerDumpCommand.php', 'Symfony\\Component\\VarDumper\\Dumper\\AbstractDumper' => $vendorDir . '/symfony/var-dumper/Dumper/AbstractDumper.php', 'Symfony\\Component\\VarDumper\\Dumper\\CliDumper' => $vendorDir . '/symfony/var-dumper/Dumper/CliDumper.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\CliContextProvider' => $vendorDir . '/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface' => $vendorDir . '/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\RequestContextProvider' => $vendorDir . '/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\SourceContextProvider' => $vendorDir . '/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextualizedDumper' => $vendorDir . '/symfony/var-dumper/Dumper/ContextualizedDumper.php', 'Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' => $vendorDir . '/symfony/var-dumper/Dumper/DataDumperInterface.php', 'Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper' => $vendorDir . '/symfony/var-dumper/Dumper/HtmlDumper.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ServerDumper' => $vendorDir . '/symfony/var-dumper/Dumper/ServerDumper.php', 'Symfony\\Component\\VarDumper\\Exception\\ThrowingCasterException' => $vendorDir . '/symfony/var-dumper/Exception/ThrowingCasterException.php', + 'Symfony\\Component\\VarDumper\\Server\\Connection' => $vendorDir . '/symfony/var-dumper/Server/Connection.php', + 'Symfony\\Component\\VarDumper\\Server\\DumpServer' => $vendorDir . '/symfony/var-dumper/Server/DumpServer.php', 'Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait' => $vendorDir . '/symfony/var-dumper/Test/VarDumperTestTrait.php', 'Symfony\\Component\\VarDumper\\VarDumper' => $vendorDir . '/symfony/var-dumper/VarDumper.php', 'Symfony\\Component\\Yaml\\Command\\LintCommand' => $vendorDir . '/symfony/yaml/Command/LintCommand.php', @@ -5650,6 +5672,7 @@ 'Symfony\\Polyfill\\Php56\\Php56' => $vendorDir . '/symfony/polyfill-php56/Php56.php', 'Symfony\\Polyfill\\Php70\\Php70' => $vendorDir . '/symfony/polyfill-php70/Php70.php', 'Symfony\\Polyfill\\Php72\\Php72' => $vendorDir . '/symfony/polyfill-php72/Php72.php', + 'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php', 'Symfony\\Polyfill\\Util\\Binary' => $vendorDir . '/symfony/polyfill-util/Binary.php', 'Symfony\\Polyfill\\Util\\BinaryNoFuncOverload' => $vendorDir . '/symfony/polyfill-util/BinaryNoFuncOverload.php', 'Symfony\\Polyfill\\Util\\BinaryOnFuncOverload' => $vendorDir . '/symfony/polyfill-util/BinaryOnFuncOverload.php', @@ -6087,6 +6110,8 @@ 'Twig_Util_TemplateDirIterator' => $vendorDir . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php', 'TwitterAPIExchange' => $vendorDir . '/j7mbo/twitter-api-php/TwitterAPIExchange.php', 'TypeError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/TypeError.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', 'Webmozart\\Assert\\Assert' => $vendorDir . '/webmozart/assert/src/Assert.php', 'Webmozart\\PathUtil\\Path' => $vendorDir . '/webmozart/path-util/src/Path.php', 'Webmozart\\PathUtil\\Url' => $vendorDir . '/webmozart/path-util/src/Url.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index b22ca8de96339431240a0647625d1dfea7bf9141..d4058ce4d2b2f51b67909d6154f366e3ff91de19 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -9,10 +9,11 @@ '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '023d27dca8066ef29e6739335ea73bad' => $vendorDir . '/symfony/polyfill-php70/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php', - '7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', + '7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 412280ae7b5cbb06e4678e940542f958401acc65..329631847bf42d6011fad8f009ffaae7de592d66 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -16,6 +16,7 @@ 'Twig\\' => array($vendorDir . '/twig/twig/src'), 'TYPO3\\PharStreamWrapper\\' => array($vendorDir . '/typo3/phar-stream-wrapper/src'), 'Symfony\\Polyfill\\Util\\' => array($vendorDir . '/symfony/polyfill-util'), + 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), 'Symfony\\Polyfill\\Php70\\' => array($vendorDir . '/symfony/polyfill-php70'), 'Symfony\\Polyfill\\Php56\\' => array($vendorDir . '/symfony/polyfill-php56'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index c8ca349501049dec399f01d47e7c5d1981769d48..fc202c02e4a6e7ee78ff762ff5adde485f48b181 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -10,10 +10,11 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '023d27dca8066ef29e6739335ea73bad' => __DIR__ . '/..' . '/symfony/polyfill-php70/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php', - '7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', + '7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', @@ -70,6 +71,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'S' => array ( 'Symfony\\Polyfill\\Util\\' => 22, + 'Symfony\\Polyfill\\Php80\\' => 23, 'Symfony\\Polyfill\\Php72\\' => 23, 'Symfony\\Polyfill\\Php70\\' => 23, 'Symfony\\Polyfill\\Php56\\' => 23, @@ -262,6 +264,10 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-util', ), + 'Symfony\\Polyfill\\Php80\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', + ), 'Symfony\\Polyfill\\Php72\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', @@ -870,6 +876,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Asm89\\Stack\\Cors' => __DIR__ . '/..' . '/asm89/stack-cors/src/Asm89/Stack/Cors.php', 'Asm89\\Stack\\CorsService' => __DIR__ . '/..' . '/asm89/stack-cors/src/Asm89/Stack/CorsService.php', 'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php', + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Basho\\Riak' => __DIR__ . '/..' . '/phpfastcache/riak-client/src/Riak.php', 'Basho\\Riak\\Api' => __DIR__ . '/..' . '/phpfastcache/riak-client/src/Riak/Api.php', 'Basho\\Riak\\ApiInterface' => __DIR__ . '/..' . '/phpfastcache/riak-client/src/Riak/ApiInterface.php', @@ -5310,6 +5317,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion\\ShellPathCompletion' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/Completion/ShellPathCompletion.php', 'Stecman\\Component\\Symfony\\Console\\BashCompletion\\EnvironmentCompletionContext' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/EnvironmentCompletionContext.php', 'Stecman\\Component\\Symfony\\Console\\BashCompletion\\HookFactory' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/HookFactory.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'Symfony\\Bridge\\PsrHttpMessage\\Factory\\DiactorosFactory' => __DIR__ . '/..' . '/symfony/psr-http-message-bridge/Factory/DiactorosFactory.php', 'Symfony\\Bridge\\PsrHttpMessage\\Factory\\HttpFoundationFactory' => __DIR__ . '/..' . '/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php', 'Symfony\\Bridge\\PsrHttpMessage\\Factory\\PsrHttpFactory' => __DIR__ . '/..' . '/symfony/psr-http-message-bridge/Factory/PsrHttpFactory.php', @@ -6381,13 +6389,20 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Symfony\\Component\\VarDumper\\Caster\\DOMCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DOMCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\DateCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DateCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DoctrineCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\DsCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DsCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\DsPairStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DsPairStub.php', 'Symfony\\Component\\VarDumper\\Caster\\EnumStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/EnumStub.php', 'Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ExceptionCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\FrameStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/FrameStub.php', + 'Symfony\\Component\\VarDumper\\Caster\\GmpCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/GmpCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\ImagineCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ImagineCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\ImgStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ImgStub.php', + 'Symfony\\Component\\VarDumper\\Caster\\IntlCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/IntlCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\LinkStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/LinkStub.php', - 'Symfony\\Component\\VarDumper\\Caster\\MongoCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/MongoCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\MemcachedCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/MemcachedCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\PdoCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/PdoCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/PgSqlCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\ProxyManagerCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ProxyManagerCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\RedisCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/RedisCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ReflectionCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\ResourceCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ResourceCaster.php', @@ -6395,6 +6410,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Symfony\\Component\\VarDumper\\Caster\\StubCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/StubCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/SymfonyCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\TraceStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/TraceStub.php', + 'Symfony\\Component\\VarDumper\\Caster\\UuidCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/UuidCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\XmlReaderCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/XmlReaderCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/XmlResourceCaster.php', 'Symfony\\Component\\VarDumper\\Cloner\\AbstractCloner' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/AbstractCloner.php', @@ -6404,11 +6420,23 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Symfony\\Component\\VarDumper\\Cloner\\DumperInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/DumperInterface.php', 'Symfony\\Component\\VarDumper\\Cloner\\Stub' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/Stub.php', 'Symfony\\Component\\VarDumper\\Cloner\\VarCloner' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/VarCloner.php', + 'Symfony\\Component\\VarDumper\\Command\\Descriptor\\CliDescriptor' => __DIR__ . '/..' . '/symfony/var-dumper/Command/Descriptor/CliDescriptor.php', + 'Symfony\\Component\\VarDumper\\Command\\Descriptor\\DumpDescriptorInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php', + 'Symfony\\Component\\VarDumper\\Command\\Descriptor\\HtmlDescriptor' => __DIR__ . '/..' . '/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php', + 'Symfony\\Component\\VarDumper\\Command\\ServerDumpCommand' => __DIR__ . '/..' . '/symfony/var-dumper/Command/ServerDumpCommand.php', 'Symfony\\Component\\VarDumper\\Dumper\\AbstractDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/AbstractDumper.php', 'Symfony\\Component\\VarDumper\\Dumper\\CliDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/CliDumper.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\CliContextProvider' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\RequestContextProvider' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\SourceContextProvider' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ContextualizedDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextualizedDumper.php', 'Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/DataDumperInterface.php', 'Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/HtmlDumper.php', + 'Symfony\\Component\\VarDumper\\Dumper\\ServerDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ServerDumper.php', 'Symfony\\Component\\VarDumper\\Exception\\ThrowingCasterException' => __DIR__ . '/..' . '/symfony/var-dumper/Exception/ThrowingCasterException.php', + 'Symfony\\Component\\VarDumper\\Server\\Connection' => __DIR__ . '/..' . '/symfony/var-dumper/Server/Connection.php', + 'Symfony\\Component\\VarDumper\\Server\\DumpServer' => __DIR__ . '/..' . '/symfony/var-dumper/Server/DumpServer.php', 'Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait' => __DIR__ . '/..' . '/symfony/var-dumper/Test/VarDumperTestTrait.php', 'Symfony\\Component\\VarDumper\\VarDumper' => __DIR__ . '/..' . '/symfony/var-dumper/VarDumper.php', 'Symfony\\Component\\Yaml\\Command\\LintCommand' => __DIR__ . '/..' . '/symfony/yaml/Command/LintCommand.php', @@ -6430,6 +6458,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Symfony\\Polyfill\\Php56\\Php56' => __DIR__ . '/..' . '/symfony/polyfill-php56/Php56.php', 'Symfony\\Polyfill\\Php70\\Php70' => __DIR__ . '/..' . '/symfony/polyfill-php70/Php70.php', 'Symfony\\Polyfill\\Php72\\Php72' => __DIR__ . '/..' . '/symfony/polyfill-php72/Php72.php', + 'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php', 'Symfony\\Polyfill\\Util\\Binary' => __DIR__ . '/..' . '/symfony/polyfill-util/Binary.php', 'Symfony\\Polyfill\\Util\\BinaryNoFuncOverload' => __DIR__ . '/..' . '/symfony/polyfill-util/BinaryNoFuncOverload.php', 'Symfony\\Polyfill\\Util\\BinaryOnFuncOverload' => __DIR__ . '/..' . '/symfony/polyfill-util/BinaryOnFuncOverload.php', @@ -6867,6 +6896,8 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Twig_Util_TemplateDirIterator' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php', 'TwitterAPIExchange' => __DIR__ . '/..' . '/j7mbo/twitter-api-php/TwitterAPIExchange.php', 'TypeError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/TypeError.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', 'Webmozart\\Assert\\Assert' => __DIR__ . '/..' . '/webmozart/assert/src/Assert.php', 'Webmozart\\PathUtil\\Path' => __DIR__ . '/..' . '/webmozart/path-util/src/Path.php', 'Webmozart\\PathUtil\\Url' => __DIR__ . '/..' . '/webmozart/path-util/src/Url.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 83f312305f1df209c657660dea5360433e67d0f1..c1ca7ec8dd402a8d16f567427f4887e23d90467c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2754,30 +2754,27 @@ }, { "name": "drupal/config_direct_save", - "version": "1.0.0", - "version_normalized": "1.0.0.0", + "version": "2.1.0", + "version_normalized": "2.1.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/config_direct_save.git", - "reference": "8.x-1.0" + "reference": "8.x-2.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/config_direct_save-8.x-1.0.zip", - "reference": "8.x-1.0", - "shasum": "dae776d96310aa01aa6e3c536821a1b496ffae1f" + "url": "https://ftp.drupal.org/files/projects/config_direct_save-8.x-2.1.zip", + "reference": "8.x-2.1", + "shasum": "24a3668db87b1bf001b038614dc3865d2ec5e374" }, "require": { - "drupal/core": "~8.0" + "drupal/core": "^8 || ^9" }, "type": "drupal-module", "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - }, "drupal": { - "version": "8.x-1.0", - "datestamp": "1476108239", + "version": "8.x-2.1", + "datestamp": "1618700636", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -2798,7 +2795,7 @@ "description": "This module allow you to export configuration after changes", "homepage": "https://www.drupal.org/project/config_direct_save", "support": { - "source": "http://cgit.drupalcode.org/config_direct_save" + "source": "https://git.drupalcode.org/project/config_direct_save" }, "install-path": "../../web/modules/config_direct_save" }, @@ -14285,6 +14282,92 @@ ], "install-path": "../symfony/polyfill-php72" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.22.1", + "version_normalized": "1.22.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2021-01-07T16:49:33+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "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.22.1" + }, + "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" + } + ], + "install-path": "../symfony/polyfill-php80" + }, { "name": "symfony/polyfill-util", "version": "v1.17.0", @@ -14783,36 +14866,44 @@ }, { "name": "symfony/var-dumper", - "version": "v3.4.47", - "version_normalized": "3.4.47.0", + "version": "v4.4.21", + "version_normalized": "4.4.21.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "0719f6cf4633a38b2c1585140998579ce23b4b7d" + "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0719f6cf4633a38b2c1585140998579ce23b4b7d", - "reference": "0719f6cf4633a38b2c1585140998579ce23b4b7d", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0da0e174f728996f5d5072d6a9f0a42259dbc806", + "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", + "symfony/polyfill-php80": "^1.15" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" }, "require-dev": { "ext-iconv": "*", - "twig/twig": "~1.34|~2.4" + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.43|^2.13|^3.0.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", "ext-intl": "To show region name in time zone dump", - "ext-symfony_debug": "" + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2020-10-24T10:57:07+00:00", + "time": "2021-03-27T19:49:03+00:00", + "bin": [ + "Resources/bin/var-dump-server" + ], "type": "library", "installation-source": "dist", "autoload": { @@ -14840,12 +14931,15 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony mechanism for exploring and dumping PHP variables", + "description": "Provides mechanisms for walking through any arbitrary PHP variable", "homepage": "https://symfony.com", "keywords": [ "debug", "dump" ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v4.4.21" + }, "funding": [ { "url": "https://symfony.com/sponsor", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 8c29078e77a85abb5cf52e07b7a3fec30b8e1ed5..589efebc86f778ad8c39e7db0cc1dc15993fa01e 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => '95c9013593fdd0fdd7afdcaa3e25f1200a89509c', + 'reference' => '325400378ff6eb275598d7918db9b563266840a6', 'name' => 'osu-asc-webservices/d8-upstream', ), 'versions' => @@ -549,12 +549,12 @@ ), 'drupal/config_direct_save' => array ( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', + 'pretty_version' => '2.1.0', + 'version' => '2.1.0.0', 'aliases' => array ( ), - 'reference' => '8.x-1.0', + 'reference' => '8.x-2.1', ), 'drupal/config_filter' => array ( @@ -2281,7 +2281,7 @@ 'aliases' => array ( ), - 'reference' => '95c9013593fdd0fdd7afdcaa3e25f1200a89509c', + 'reference' => '325400378ff6eb275598d7918db9b563266840a6', ), 'pantheon-systems/quicksilver-pushback' => array ( @@ -2938,6 +2938,15 @@ ), 'reference' => 'f048e612a3905f34931127360bdd2def19a5e582', ), + 'symfony/polyfill-php80' => + array ( + 'pretty_version' => 'v1.22.1', + 'version' => '1.22.1.0', + 'aliases' => + array ( + ), + 'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91', + ), 'symfony/polyfill-util' => array ( 'pretty_version' => 'v1.17.0', @@ -3003,12 +3012,12 @@ ), 'symfony/var-dumper' => array ( - 'pretty_version' => 'v3.4.47', - 'version' => '3.4.47.0', + 'pretty_version' => 'v4.4.21', + 'version' => '4.4.21.0', 'aliases' => array ( ), - 'reference' => '0719f6cf4633a38b2c1585140998579ce23b4b7d', + 'reference' => '0da0e174f728996f5d5072d6a9f0a42259dbc806', ), 'symfony/yaml' => array ( diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..5593b1d84f74a170e02b3e58408dc189ea838434 --- /dev/null +++ b/vendor/symfony/polyfill-php80/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php new file mode 100644 index 0000000000000000000000000000000000000000..5fef5118420d305d59bffc58c005bb97978d6c9e --- /dev/null +++ b/vendor/symfony/polyfill-php80/Php80.php @@ -0,0 +1,105 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan <ion.bazan@gmail.com> + * @author Nico Oelgart <nicoswd@gmail.com> + * @author Nicolas Grekas <p@tchwork.com> + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle))); + } +} diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eaa3050abc11f9852eed71f79dccaa3688f67854 --- /dev/null +++ b/vendor/symfony/polyfill-php80/README.md @@ -0,0 +1,24 @@ +Symfony Polyfill / Php80 +======================== + +This component provides features added to PHP 8.0 core: + +- `Stringable` interface +- [`fdiv`](https://php.net/fdiv) +- `ValueError` class +- `UnhandledMatchError` class +- `FILTER_VALIDATE_BOOL` constant +- [`get_debug_type`](https://php.net/get_debug_type) +- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) +- [`str_contains`](https://php.net/str_contains) +- [`str_starts_with`](https://php.net/str_starts_with) +- [`str_ends_with`](https://php.net/str_ends_with) +- [`get_resource_id`](https://php.net/get_resource_id) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 0000000000000000000000000000000000000000..7ea6d2772dcaa175ec17ec39b852553fd189b5cc --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,22 @@ +<?php + +#[Attribute(Attribute::TARGET_CLASS)] +final class Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php new file mode 100644 index 0000000000000000000000000000000000000000..77e037cb58d5acc48e5eb675c337fc2acff1d3f3 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -0,0 +1,11 @@ +<?php + +if (\PHP_VERSION_ID < 80000) { + interface Stringable + { + /** + * @return string + */ + public function __toString(); + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 0000000000000000000000000000000000000000..7fb2000e9e164de1e909cd366e9640a5a413eee8 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,5 @@ +<?php + +class UnhandledMatchError extends Error +{ +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php new file mode 100644 index 0000000000000000000000000000000000000000..99843cad3353ce7e3e295fb452ed8307e86a1b57 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -0,0 +1,5 @@ +<?php + +class ValueError extends Error +{ +} diff --git a/vendor/symfony/polyfill-php80/bootstrap.php b/vendor/symfony/polyfill-php80/bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..4f791f9e3f022b8c78f7101ff08474704fa73826 --- /dev/null +++ b/vendor/symfony/polyfill-php80/bootstrap.php @@ -0,0 +1,42 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(string $haystack, string $needle): bool { return p\Php80::str_contains($haystack, $needle); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(string $haystack, string $needle): bool { return p\Php80::str_starts_with($haystack, $needle); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(string $haystack, string $needle): bool { return p\Php80::str_ends_with($haystack, $needle); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..a9e6813c9706a4b82a79f9804e718ce22e340ab5 --- /dev/null +++ b/vendor/symfony/polyfill-php80/composer.json @@ -0,0 +1,40 @@ +{ + "name": "symfony/polyfill-php80", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "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" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/vendor/symfony/var-dumper/.gitignore b/vendor/symfony/var-dumper/.gitignore deleted file mode 100644 index 5414c2c655e72ae741a2eccd1d69d06ce7c20f02..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -phpunit.xml -vendor/ diff --git a/vendor/symfony/var-dumper/CHANGELOG.md b/vendor/symfony/var-dumper/CHANGELOG.md index 2d44cad2259c0642765df2ef3b5cf8ea1ebe81c9..94b1c17d1d5381d70da273642909ab5edb2d6355 100644 --- a/vendor/symfony/var-dumper/CHANGELOG.md +++ b/vendor/symfony/var-dumper/CHANGELOG.md @@ -1,6 +1,46 @@ CHANGELOG ========= +4.4.0 +----- + + * added `VarDumperTestTrait::setUpVarDumper()` and `VarDumperTestTrait::tearDownVarDumper()` + to configure casters & flags to use in tests + * added `ImagineCaster` and infrastructure to dump images + * added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data + * added `UuidCaster` + * made all casters final + * added support for the `NO_COLOR` env var (https://no-color.org/) + +4.3.0 +----- + + * added `DsCaster` to support dumping the contents of data structures from the Ds extension + +4.2.0 +----- + + * support selecting the format to use by setting the environment variable `VAR_DUMPER_FORMAT` to `html` or `cli` + +4.1.0 +----- + + * added a `ServerDumper` to send serialized Data clones to a server + * added a `ServerDumpCommand` and `DumpServer` to run a server collecting + and displaying dumps on a single place with multiple formats support + * added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support + +4.0.0 +----- + + * support for passing `\ReflectionClass` instances to the `Caster::castObject()` + method has been dropped, pass class names as strings instead + * the `Data::getRawData()` method has been removed + * the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0` + argument and moves `$message = ''` argument at 4th position. + * the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0` + argument and moves `$message = ''` argument at 4th position. + 3.4.0 ----- @@ -10,4 +50,4 @@ CHANGELOG 2.7.0 ----- - * deprecated Cloner\Data::getLimitedClone(). Use withMaxDepth, withMaxItemsPerDepth or withRefHandles instead. + * deprecated `Cloner\Data::getLimitedClone()`. Use `withMaxDepth`, `withMaxItemsPerDepth` or `withRefHandles` instead. diff --git a/vendor/symfony/var-dumper/Caster/AmqpCaster.php b/vendor/symfony/var-dumper/Caster/AmqpCaster.php index dc7a6414fca27e1ae9bef81d836917a128c67a8b..60045ff7b03e95b5883b57f1a3742caa47257dfa 100644 --- a/vendor/symfony/var-dumper/Caster/AmqpCaster.php +++ b/vendor/symfony/var-dumper/Caster/AmqpCaster.php @@ -17,10 +17,12 @@ * Casts Amqp related classes to array representation. * * @author Grégoire Pineau <lyrixx@lyrixx.info> + * + * @final since Symfony 4.4 */ class AmqpCaster { - private static $flags = [ + private const FLAGS = [ \AMQP_DURABLE => 'AMQP_DURABLE', \AMQP_PASSIVE => 'AMQP_PASSIVE', \AMQP_EXCLUSIVE => 'AMQP_EXCLUSIVE', @@ -37,7 +39,7 @@ class AmqpCaster \AMQP_REQUEUE => 'AMQP_REQUEUE', ]; - private static $exchangeTypes = [ + private const EXCHANGE_TYPES = [ \AMQP_EX_TYPE_DIRECT => 'AMQP_EX_TYPE_DIRECT', \AMQP_EX_TYPE_FANOUT => 'AMQP_EX_TYPE_FANOUT', \AMQP_EX_TYPE_TOPIC => 'AMQP_EX_TYPE_TOPIC', @@ -131,7 +133,7 @@ public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, $isN $prefix.'flags' => self::extractFlags($c->getFlags()), ]; - $type = isset(self::$exchangeTypes[$c->getType()]) ? new ConstStub(self::$exchangeTypes[$c->getType()], $c->getType()) : $c->getType(); + $type = isset(self::EXCHANGE_TYPES[$c->getType()]) ? new ConstStub(self::EXCHANGE_TYPES[$c->getType()], $c->getType()) : $c->getType(); // Recent version of the extension already expose private properties if (isset($a["\x00AMQPExchange\x00name"])) { @@ -191,11 +193,11 @@ public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, $isN return $a; } - private static function extractFlags($flags) + private static function extractFlags(int $flags): ConstStub { $flagsArray = []; - foreach (self::$flags as $value => $name) { + foreach (self::FLAGS as $value => $name) { if ($flags & $value) { $flagsArray[] = $name; } diff --git a/vendor/symfony/var-dumper/Caster/ArgsStub.php b/vendor/symfony/var-dumper/Caster/ArgsStub.php index 081fb47e996320b4fb5e0fbe410bf0584932702c..f8b485bd40c3f8203e7770f41d0612756bf7d2ca 100644 --- a/vendor/symfony/var-dumper/Caster/ArgsStub.php +++ b/vendor/symfony/var-dumper/Caster/ArgsStub.php @@ -22,9 +22,9 @@ class ArgsStub extends EnumStub { private static $parameters = []; - public function __construct(array $args, $function, $class) + public function __construct(array $args, string $function, ?string $class) { - list($variadic, $params) = self::getParameters($function, $class); + [$variadic, $params] = self::getParameters($function, $class); $values = []; foreach ($args as $k => $v) { @@ -49,7 +49,7 @@ public function __construct(array $args, $function, $class) } } - private static function getParameters($function, $class) + private static function getParameters(string $function, ?string $class): array { if (isset(self::$parameters[$k = $class.'::'.$function])) { return self::$parameters[$k]; @@ -68,7 +68,7 @@ private static function getParameters($function, $class) if ($v->isPassedByReference()) { $k = '&'.$k; } - if (method_exists($v, 'isVariadic') && $v->isVariadic()) { + if ($v->isVariadic()) { $variadic .= $k; } else { $params[] = $k; diff --git a/vendor/symfony/var-dumper/Caster/Caster.php b/vendor/symfony/var-dumper/Caster/Caster.php index a6ebc25bddd1ff1c5f84160043c5d1d05a347a30..d35f3230b0ef5c6ef6740054bd86d5fcfe7628f8 100644 --- a/vendor/symfony/var-dumper/Caster/Caster.php +++ b/vendor/symfony/var-dumper/Caster/Caster.php @@ -22,38 +22,31 @@ */ class Caster { - const EXCLUDE_VERBOSE = 1; - const EXCLUDE_VIRTUAL = 2; - const EXCLUDE_DYNAMIC = 4; - const EXCLUDE_PUBLIC = 8; - const EXCLUDE_PROTECTED = 16; - const EXCLUDE_PRIVATE = 32; - const EXCLUDE_NULL = 64; - const EXCLUDE_EMPTY = 128; - const EXCLUDE_NOT_IMPORTANT = 256; - const EXCLUDE_STRICT = 512; - - const PREFIX_VIRTUAL = "\0~\0"; - const PREFIX_DYNAMIC = "\0+\0"; - const PREFIX_PROTECTED = "\0*\0"; + public const EXCLUDE_VERBOSE = 1; + public const EXCLUDE_VIRTUAL = 2; + public const EXCLUDE_DYNAMIC = 4; + public const EXCLUDE_PUBLIC = 8; + public const EXCLUDE_PROTECTED = 16; + public const EXCLUDE_PRIVATE = 32; + public const EXCLUDE_NULL = 64; + public const EXCLUDE_EMPTY = 128; + public const EXCLUDE_NOT_IMPORTANT = 256; + public const EXCLUDE_STRICT = 512; + + public const PREFIX_VIRTUAL = "\0~\0"; + public const PREFIX_DYNAMIC = "\0+\0"; + public const PREFIX_PROTECTED = "\0*\0"; /** * Casts objects to arrays and adds the dynamic property prefix. * * @param object $obj The object to cast - * @param string $class The class of the object * @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not * * @return array The array-cast of the object, with prefixed dynamic properties */ - public static function castObject($obj, $class, $hasDebugInfo = false, $debugClass = null) + public static function castObject($obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array { - if ($class instanceof \ReflectionClass) { - @trigger_error(sprintf('Passing a ReflectionClass to "%s()" is deprecated since Symfony 3.3 and will be unsupported in 4.0. Pass the class name as string instead.', __METHOD__), \E_USER_DEPRECATED); - $hasDebugInfo = $class->hasMethod('__debugInfo'); - $class = $class->name; - } - if ($hasDebugInfo) { try { $debugInfo = $obj->__debugInfo(); @@ -71,17 +64,7 @@ public static function castObject($obj, $class, $hasDebugInfo = false, $debugCla if ($a) { static $publicProperties = []; - if (null === $debugClass) { - if (\PHP_VERSION_ID >= 80000) { - $debugClass = get_debug_type($obj); - } else { - $debugClass = $class; - - if (isset($debugClass[15]) && "\0" === $debugClass[15]) { - $debugClass = (get_parent_class($debugClass) ?: key(class_implements($debugClass)) ?: 'class').'@anonymous'; - } - } - } + $debugClass = $debugClass ?? get_debug_type($obj); $i = 0; $prefixedKeys = []; @@ -139,7 +122,7 @@ public static function castObject($obj, $class, $hasDebugInfo = false, $debugCla * * @return array The filtered array */ - public static function filter(array $a, $filter, array $listedProperties = [], &$count = 0) + public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array { $count = 0; @@ -180,7 +163,7 @@ public static function filter(array $a, $filter, array $listedProperties = [], & return $a; } - public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, $isNested) + public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, bool $isNested): array { if (isset($a['__PHP_Incomplete_Class_Name'])) { $stub->class .= '('.$a['__PHP_Incomplete_Class_Name'].')'; diff --git a/vendor/symfony/var-dumper/Caster/ClassStub.php b/vendor/symfony/var-dumper/Caster/ClassStub.php index 1a85098e1581bb59dfbcd872cf6b86c33de13431..612a7ca2d9933fb7e2c3bd24323eeb66a1065100 100644 --- a/vendor/symfony/var-dumper/Caster/ClassStub.php +++ b/vendor/symfony/var-dumper/Caster/ClassStub.php @@ -11,6 +11,8 @@ namespace Symfony\Component\VarDumper\Caster; +use Symfony\Component\VarDumper\Cloner\Stub; + /** * Represents a PHP class identifier. * @@ -22,16 +24,10 @@ class ClassStub extends ConstStub * @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name * @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier */ - public function __construct($identifier, $callable = null) + public function __construct(string $identifier, $callable = null) { $this->value = $identifier; - if (0 < $i = strrpos($identifier, '\\')) { - $this->attr['ellipsis'] = \strlen($identifier) - $i; - $this->attr['ellipsis-type'] = 'class'; - $this->attr['ellipsis-tail'] = 1; - } - try { if (null !== $callable) { if ($callable instanceof \Closure) { @@ -58,8 +54,31 @@ public function __construct($identifier, $callable = null) $r = new \ReflectionClass($r[0]); } } + + if (false !== strpos($identifier, "@anonymous\0")) { + $this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { + return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; + }, $identifier); + } + + if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) { + $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true, Caster::EXCLUDE_VERBOSE); + $s = ReflectionCaster::getSignature($s); + + if ('()' === substr($identifier, -2)) { + $this->value = substr_replace($identifier, $s, -2); + } else { + $this->value .= $s; + } + } } catch (\ReflectionException $e) { return; + } finally { + if (0 < $i = strrpos($this->value, '\\')) { + $this->attr['ellipsis'] = \strlen($this->value) - $i; + $this->attr['ellipsis-type'] = 'class'; + $this->attr['ellipsis-tail'] = 1; + } } if ($f = $r->getFileName()) { @@ -75,9 +94,9 @@ public static function wrapCallable($callable) } if (!\is_array($callable)) { - $callable = new static($callable); + $callable = new static($callable, $callable); } elseif (\is_string($callable[0])) { - $callable[0] = new static($callable[0]); + $callable[0] = new static($callable[0], $callable); } else { $callable[1] = new static($callable[1], $callable); } diff --git a/vendor/symfony/var-dumper/Caster/ConstStub.php b/vendor/symfony/var-dumper/Caster/ConstStub.php index 26c0010b66a8cac06c3ce25e8b1c2ef08d0b013a..8b0179745f346479282aaeb0ee6ffcb4391c9b94 100644 --- a/vendor/symfony/var-dumper/Caster/ConstStub.php +++ b/vendor/symfony/var-dumper/Caster/ConstStub.php @@ -20,12 +20,15 @@ */ class ConstStub extends Stub { - public function __construct($name, $value) + public function __construct(string $name, $value = null) { $this->class = $name; - $this->value = $value; + $this->value = 1 < \func_num_args() ? $value : $name; } + /** + * @return string + */ public function __toString() { return (string) $this->value; diff --git a/vendor/symfony/var-dumper/Caster/CutStub.php b/vendor/symfony/var-dumper/Caster/CutStub.php index 690338f542d97a8ad4f7bfe4f79cb3ebe20857ca..464c6dbd1905d620e7b6052886f478bd326f3f0e 100644 --- a/vendor/symfony/var-dumper/Caster/CutStub.php +++ b/vendor/symfony/var-dumper/Caster/CutStub.php @@ -28,6 +28,11 @@ public function __construct($value) case 'object': $this->type = self::TYPE_OBJECT; $this->class = \get_class($value); + + if ($value instanceof \Closure) { + ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE); + } + $this->cut = -1; break; diff --git a/vendor/symfony/var-dumper/Caster/DOMCaster.php b/vendor/symfony/var-dumper/Caster/DOMCaster.php index fef3d432a7cdd07eb8c6781491831734f2879296..5f2b9cd115304b1a0d4cc95eef81be23d1d8e2d5 100644 --- a/vendor/symfony/var-dumper/Caster/DOMCaster.php +++ b/vendor/symfony/var-dumper/Caster/DOMCaster.php @@ -17,10 +17,12 @@ * Casts DOM related classes to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class DOMCaster { - private static $errorCodes = [ + private const ERROR_CODES = [ \DOM_PHP_ERR => 'DOM_PHP_ERR', \DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR', \DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR', @@ -40,7 +42,7 @@ class DOMCaster \DOM_VALIDATION_ERR => 'DOM_VALIDATION_ERR', ]; - private static $nodeTypes = [ + private const NODE_TYPES = [ \XML_ELEMENT_NODE => 'XML_ELEMENT_NODE', \XML_ATTRIBUTE_NODE => 'XML_ATTRIBUTE_NODE', \XML_TEXT_NODE => 'XML_TEXT_NODE', @@ -64,8 +66,8 @@ class DOMCaster public static function castException(\DOMException $e, array $a, Stub $stub, $isNested) { $k = Caster::PREFIX_PROTECTED.'code'; - if (isset($a[$k], self::$errorCodes[$a[$k]])) { - $a[$k] = new ConstStub(self::$errorCodes[$a[$k]], $a[$k]); + if (isset($a[$k], self::ERROR_CODES[$a[$k]])) { + $a[$k] = new ConstStub(self::ERROR_CODES[$a[$k]], $a[$k]); } return $a; @@ -95,7 +97,7 @@ public static function castNode(\DOMNode $dom, array $a, Stub $stub, $isNested) $a += [ 'nodeName' => $dom->nodeName, 'nodeValue' => new CutStub($dom->nodeValue), - 'nodeType' => new ConstStub(self::$nodeTypes[$dom->nodeType], $dom->nodeType), + 'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType), 'parentNode' => new CutStub($dom->parentNode), 'childNodes' => $dom->childNodes, 'firstChild' => new CutStub($dom->firstChild), @@ -119,7 +121,7 @@ public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $a += [ 'nodeName' => $dom->nodeName, 'nodeValue' => new CutStub($dom->nodeValue), - 'nodeType' => new ConstStub(self::$nodeTypes[$dom->nodeType], $dom->nodeType), + 'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType), 'prefix' => $dom->prefix, 'localName' => $dom->localName, 'namespaceURI' => $dom->namespaceURI, diff --git a/vendor/symfony/var-dumper/Caster/DateCaster.php b/vendor/symfony/var-dumper/Caster/DateCaster.php index 70f229a0d8b7d9d3eacf04ddc1608b6267ab08ed..171fbde55c3bc1a8afa6ed96b8ac10e116f94cb9 100644 --- a/vendor/symfony/var-dumper/Caster/DateCaster.php +++ b/vendor/symfony/var-dumper/Caster/DateCaster.php @@ -17,9 +17,13 @@ * Casts DateTimeInterface related classes to array representation. * * @author Dany Maillard <danymaillard93b@gmail.com> + * + * @final since Symfony 4.4 */ class DateCaster { + private const PERIOD_LIMIT = 3; + public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, $isNested, $filter) { $prefix = Caster::PREFIX_VIRTUAL; @@ -54,7 +58,7 @@ public static function castInterval(\DateInterval $interval, array $a, Stub $stu return $filter & Caster::EXCLUDE_VERBOSE ? $i : $i + $a; } - private static function formatInterval(\DateInterval $i) + private static function formatInterval(\DateInterval $i): string { $format = '%R '; @@ -65,12 +69,7 @@ private static function formatInterval(\DateInterval $i) $format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : ''); } - if (\PHP_VERSION_ID >= 70100 && isset($i->f)) { - $format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : ''; - } else { - $format .= $i->h || $i->i || $i->s ? '%H:%I:%S' : ''; - } - + $format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : ''; $format = '%R ' === $format ? '0s' : $format; return $i->format(rtrim($format)); @@ -80,7 +79,7 @@ public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stu { $location = $timeZone->getLocation(); $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P'); - $title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code'], \Locale::getDefault()) : ''; + $title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : ''; $z = [Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title)]; @@ -89,15 +88,11 @@ public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stu public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNested, $filter) { - if (\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) { // see https://bugs.php.net/71635 - return $a; - } - $dates = []; if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/74639 foreach (clone $p as $i => $d) { - if (3 === $i) { - $now = new \DateTimeImmutable(); + if (self::PERIOD_LIMIT === $i) { + $now = new \DateTimeImmutable('now', new \DateTimeZone('UTC')); $dates[] = sprintf('%s more', ($end = $p->getEndDate()) ? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u'))) : $p->recurrences - $i @@ -121,12 +116,12 @@ public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNeste return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a; } - private static function formatDateTime(\DateTimeInterface $d, $extra = '') + private static function formatDateTime(\DateTimeInterface $d, string $extra = ''): string { return $d->format('Y-m-d H:i:'.self::formatSeconds($d->format('s'), $d->format('u')).$extra); } - private static function formatSeconds($s, $us) + private static function formatSeconds(string $s, string $us): string { return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us)); } diff --git a/vendor/symfony/var-dumper/Caster/DoctrineCaster.php b/vendor/symfony/var-dumper/Caster/DoctrineCaster.php index 696b87816ea8e9df7ad514ee1310ed8468f30053..7409508b00811e621b11cde6b40aee52103f83de 100644 --- a/vendor/symfony/var-dumper/Caster/DoctrineCaster.php +++ b/vendor/symfony/var-dumper/Caster/DoctrineCaster.php @@ -20,6 +20,8 @@ * Casts Doctrine related classes to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class DoctrineCaster { diff --git a/vendor/symfony/var-dumper/Caster/DsCaster.php b/vendor/symfony/var-dumper/Caster/DsCaster.php new file mode 100644 index 0000000000000000000000000000000000000000..11423c9b29e62401bf5a9469faba61f1507b67c8 --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/DsCaster.php @@ -0,0 +1,70 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Ds\Collection; +use Ds\Map; +use Ds\Pair; +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * Casts Ds extension classes to array representation. + * + * @author Jáchym Toušek <enumag@gmail.com> + * + * @final since Symfony 4.4 + */ +class DsCaster +{ + public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested): array + { + $a[Caster::PREFIX_VIRTUAL.'count'] = $c->count(); + $a[Caster::PREFIX_VIRTUAL.'capacity'] = $c->capacity(); + + if (!$c instanceof Map) { + $a += $c->toArray(); + } + + return $a; + } + + public static function castMap(Map $c, array $a, Stub $stub, bool $isNested): array + { + foreach ($c as $k => $v) { + $a[] = new DsPairStub($k, $v); + } + + return $a; + } + + public static function castPair(Pair $c, array $a, Stub $stub, bool $isNested): array + { + foreach ($c->toArray() as $k => $v) { + $a[Caster::PREFIX_VIRTUAL.$k] = $v; + } + + return $a; + } + + public static function castPairStub(DsPairStub $c, array $a, Stub $stub, bool $isNested): array + { + if ($isNested) { + $stub->class = Pair::class; + $stub->value = null; + $stub->handle = 0; + + $a = $c->value; + } + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Caster/DsPairStub.php b/vendor/symfony/var-dumper/Caster/DsPairStub.php new file mode 100644 index 0000000000000000000000000000000000000000..a1dcc156183e92edc38c3a0830519cfacb3363da --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/DsPairStub.php @@ -0,0 +1,28 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Nicolas Grekas <p@tchwork.com> + */ +class DsPairStub extends Stub +{ + public function __construct($key, $value) + { + $this->value = [ + Caster::PREFIX_VIRTUAL.'key' => $key, + Caster::PREFIX_VIRTUAL.'value' => $value, + ]; + } +} diff --git a/vendor/symfony/var-dumper/Caster/EnumStub.php b/vendor/symfony/var-dumper/Caster/EnumStub.php index 3cee23eac202b1dc7cad7e6ca3fb629110741e9d..7a4e98a21b4d1b52b561d2464c78a8081e001709 100644 --- a/vendor/symfony/var-dumper/Caster/EnumStub.php +++ b/vendor/symfony/var-dumper/Caster/EnumStub.php @@ -22,7 +22,7 @@ class EnumStub extends Stub { public $dumpKeys = true; - public function __construct(array $values, $dumpKeys = true) + public function __construct(array $values, bool $dumpKeys = true) { $this->value = $values; $this->dumpKeys = $dumpKeys; diff --git a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php index 62b57402f86bac753e4d237c42b7e83aaa87e9dc..3ea17526c896edcd3bf05fe526cc076938acfcc6 100644 --- a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php @@ -11,7 +11,7 @@ namespace Symfony\Component\VarDumper\Caster; -use Symfony\Component\Debug\Exception\SilencedErrorContext; +use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext; use Symfony\Component\VarDumper\Cloner\Stub; use Symfony\Component\VarDumper\Exception\ThrowingCasterException; @@ -19,6 +19,8 @@ * Casts common Exception classes to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class ExceptionCaster { @@ -71,7 +73,8 @@ public static function castThrowingCasterException(ThrowingCasterException $e, a if (isset($a[$xPrefix.'previous'], $a[$trace]) && $a[$xPrefix.'previous'] instanceof \Exception) { $b = (array) $a[$xPrefix.'previous']; - self::traceUnshift($b[$xPrefix.'trace'], \get_class($a[$xPrefix.'previous']), $b[$prefix.'file'], $b[$prefix.'line']); + $class = get_debug_type($a[$xPrefix.'previous']); + self::traceUnshift($b[$xPrefix.'trace'], $class, $b[$prefix.'file'], $b[$prefix.'line']); $a[$trace] = new TraceStub($b[$xPrefix.'trace'], false, 0, -\count($a[$trace]->value)); } @@ -135,10 +138,10 @@ public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, $is $frame = new FrameStub( [ - 'object' => isset($f['object']) ? $f['object'] : null, - 'class' => isset($f['class']) ? $f['class'] : null, - 'type' => isset($f['type']) ? $f['type'] : null, - 'function' => isset($f['function']) ? $f['function'] : null, + 'object' => $f['object'] ?? null, + 'class' => $f['class'] ?? null, + 'type' => $f['type'] ?? null, + 'function' => $f['function'] ?? null, ] + $frames[$i - 1], false, true @@ -157,7 +160,7 @@ public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, $is } $f = $frames[$i - 1]; if ($trace->keepArgs && !empty($f['args']) && $frame instanceof EnumStub) { - $frame->value['arguments'] = new ArgsStub($f['args'], isset($f['function']) ? $f['function'] : null, isset($f['class']) ? $f['class'] : null); + $frame->value['arguments'] = new ArgsStub($f['args'], $f['function'] ?? null, $f['class'] ?? null); } } elseif ('???' !== $lastCall) { $label = new ClassStub($lastCall); @@ -202,17 +205,16 @@ public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, $is $f['file'] = substr($f['file'], 0, -\strlen($match[0])); $f['line'] = (int) $match[1]; } - $caller = isset($f['function']) ? sprintf('in %s() on line %d', (isset($f['class']) ? $f['class'].$f['type'] : '').$f['function'], $f['line']) : null; $src = $f['line']; $srcKey = $f['file']; $ellipsis = new LinkStub($srcKey, 0); $srcAttr = 'collapse='.(int) $ellipsis->inVendor; - $ellipsisTail = isset($ellipsis->attr['ellipsis-tail']) ? $ellipsis->attr['ellipsis-tail'] : 0; - $ellipsis = isset($ellipsis->attr['ellipsis']) ? $ellipsis->attr['ellipsis'] : 0; + $ellipsisTail = $ellipsis->attr['ellipsis-tail'] ?? 0; + $ellipsis = $ellipsis->attr['ellipsis'] ?? 0; if (file_exists($f['file']) && 0 <= self::$srcContext) { if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) { - $template = isset($f['object']) ? $f['object'] : unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class'])); + $template = $f['object'] ?? unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class'])); $ellipsis = 0; $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : ''); @@ -222,19 +224,19 @@ public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, $is $templatePath = null; } if ($templateSrc) { - $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, $caller, 'twig', $templatePath); + $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f); $srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']]; } } } if ($srcKey == $f['file']) { - $src = self::extractSource(file_get_contents($f['file']), $f['line'], self::$srcContext, $caller, 'php', $f['file']); + $src = self::extractSource(file_get_contents($f['file']), $f['line'], self::$srcContext, 'php', $f['file'], $f); $srcKey .= ':'.$f['line']; if ($ellipsis) { $ellipsis += 1 + \strlen($f['line']); } } - $srcAttr .= '&separator= '; + $srcAttr .= sprintf('&separator= &file=%s&line=%d', rawurlencode($f['file']), $f['line']); } else { $srcAttr .= '&separator=:'; } @@ -259,7 +261,7 @@ public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, $is return $a; } - private static function filterExceptionArray($xClass, array $a, $xPrefix, $filter) + private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter): array { if (isset($a[$xPrefix.'trace'])) { $trace = $a[$xPrefix.'trace']; @@ -279,6 +281,12 @@ private static function filterExceptionArray($xClass, array $a, $xPrefix, $filte } unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); + if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) { + $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { + return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; + }, $a[Caster::PREFIX_PROTECTED.'message']); + } + if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) { $a[Caster::PREFIX_PROTECTED.'file'] = new LinkStub($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']); } @@ -286,7 +294,7 @@ private static function filterExceptionArray($xClass, array $a, $xPrefix, $filte return $a; } - private static function traceUnshift(&$trace, $class, $file, $line) + private static function traceUnshift(array &$trace, ?string $class, string $file, int $line): void { if (isset($trace[0]['file'], $trace[0]['line']) && $trace[0]['file'] === $file && $trace[0]['line'] === $line) { return; @@ -298,16 +306,41 @@ private static function traceUnshift(&$trace, $class, $file, $line) ]); } - private static function extractSource($srcLines, $line, $srcContext, $title, $lang, $file = null) + private static function extractSource(string $srcLines, int $line, int $srcContext, string $lang, ?string $file, array $frame): EnumStub { $srcLines = explode("\n", $srcLines); $src = []; for ($i = $line - 1 - $srcContext; $i <= $line - 1 + $srcContext; ++$i) { - $src[] = (isset($srcLines[$i]) ? $srcLines[$i] : '')."\n"; + $src[] = ($srcLines[$i] ?? '')."\n"; + } + + if ($frame['function'] ?? false) { + $stub = new CutStub(new \stdClass()); + $stub->class = (isset($frame['class']) ? $frame['class'].$frame['type'] : '').$frame['function']; + $stub->type = Stub::TYPE_OBJECT; + $stub->attr['cut_hash'] = true; + $stub->attr['file'] = $frame['file']; + $stub->attr['line'] = $frame['line']; + + try { + $caller = isset($frame['class']) ? new \ReflectionMethod($frame['class'], $frame['function']) : new \ReflectionFunction($frame['function']); + $stub->class .= ReflectionCaster::getSignature(ReflectionCaster::castFunctionAbstract($caller, [], $stub, true, Caster::EXCLUDE_VERBOSE)); + + if ($f = $caller->getFileName()) { + $stub->attr['file'] = $f; + $stub->attr['line'] = $caller->getStartLine(); + } + } catch (\ReflectionException $e) { + // ignore fake class/function + } + + $srcLines = ["\0~separator=\0" => $stub]; + } else { + $stub = null; + $srcLines = []; } - $srcLines = []; $ltrim = 0; do { $pad = null; @@ -334,7 +367,7 @@ private static function extractSource($srcLines, $line, $srcContext, $title, $la if ($i !== $srcContext) { $c = new ConstStub('default', $c); } else { - $c = new ConstStub($c, $title); + $c = new ConstStub($c, $stub ? 'in '.$stub->class : ''); if (null !== $file) { $c->attr['file'] = $file; $c->attr['line'] = $line; diff --git a/vendor/symfony/var-dumper/Caster/FrameStub.php b/vendor/symfony/var-dumper/Caster/FrameStub.php index 1e1194dc85b89041be0bfb5a57071a05a4ba204a..878675528f7e76c1cfd2863da512297fcda592bf 100644 --- a/vendor/symfony/var-dumper/Caster/FrameStub.php +++ b/vendor/symfony/var-dumper/Caster/FrameStub.php @@ -21,7 +21,7 @@ class FrameStub extends EnumStub public $keepArgs; public $inTraceStub; - public function __construct(array $frame, $keepArgs = true, $inTraceStub = false) + public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false) { $this->value = $frame; $this->keepArgs = $keepArgs; diff --git a/vendor/symfony/var-dumper/Caster/GmpCaster.php b/vendor/symfony/var-dumper/Caster/GmpCaster.php new file mode 100644 index 0000000000000000000000000000000000000000..2b20e15dc80a1010a816d063697b187a3641d927 --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/GmpCaster.php @@ -0,0 +1,32 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * Casts GMP objects to array representation. + * + * @author Hamza Amrouche <hamza.simperfit@gmail.com> + * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 + */ +class GmpCaster +{ + public static function castGmp(\GMP $gmp, array $a, Stub $stub, $isNested, $filter): array + { + $a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp)); + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Caster/ImagineCaster.php b/vendor/symfony/var-dumper/Caster/ImagineCaster.php new file mode 100644 index 0000000000000000000000000000000000000000..d1289da3370f3875cd9b9bb5d0fdb931d6a89616 --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/ImagineCaster.php @@ -0,0 +1,37 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Imagine\Image\ImageInterface; +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Grégoire Pineau <lyrixx@lyrixx.info> + */ +final class ImagineCaster +{ + public static function castImage(ImageInterface $c, array $a, Stub $stub, bool $isNested): array + { + $imgData = $c->get('png'); + if (\strlen($imgData) > 1 * 1000 * 1000) { + $a += [ + Caster::PREFIX_VIRTUAL.'image' => new ConstStub($c->getSize()), + ]; + } else { + $a += [ + Caster::PREFIX_VIRTUAL.'image' => new ImgStub($imgData, 'image/png', $c->getSize()), + ]; + } + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Caster/ImgStub.php b/vendor/symfony/var-dumper/Caster/ImgStub.php new file mode 100644 index 0000000000000000000000000000000000000000..05789fe336cd8b492c4bc20265baa1078e8a29d3 --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/ImgStub.php @@ -0,0 +1,26 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +/** + * @author Grégoire Pineau <lyrixx@lyrixx.info> + */ +class ImgStub extends ConstStub +{ + public function __construct(string $data, string $contentType, string $size) + { + $this->value = ''; + $this->attr['img-data'] = $data; + $this->attr['img-size'] = $size; + $this->attr['content-type'] = $contentType; + } +} diff --git a/vendor/symfony/var-dumper/Caster/IntlCaster.php b/vendor/symfony/var-dumper/Caster/IntlCaster.php new file mode 100644 index 0000000000000000000000000000000000000000..d7099cb18a8c64c9918b6153bfd5171ac3fec3cf --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/IntlCaster.php @@ -0,0 +1,172 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Nicolas Grekas <p@tchwork.com> + * @author Jan Schädlich <jan.schaedlich@sensiolabs.de> + * + * @final since Symfony 4.4 + */ +class IntlCaster +{ + public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, $isNested) + { + $a += [ + Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), + Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(), + ]; + + return self::castError($c, $a); + } + + public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, $isNested, $filter = 0) + { + $a += [ + Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), + Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(), + ]; + + if ($filter & Caster::EXCLUDE_VERBOSE) { + $stub->cut += 3; + + return self::castError($c, $a); + } + + $a += [ + Caster::PREFIX_VIRTUAL.'attributes' => new EnumStub( + [ + 'PARSE_INT_ONLY' => $c->getAttribute(\NumberFormatter::PARSE_INT_ONLY), + 'GROUPING_USED' => $c->getAttribute(\NumberFormatter::GROUPING_USED), + 'DECIMAL_ALWAYS_SHOWN' => $c->getAttribute(\NumberFormatter::DECIMAL_ALWAYS_SHOWN), + 'MAX_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_INTEGER_DIGITS), + 'MIN_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_INTEGER_DIGITS), + 'INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::INTEGER_DIGITS), + 'MAX_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_FRACTION_DIGITS), + 'MIN_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_FRACTION_DIGITS), + 'FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::FRACTION_DIGITS), + 'MULTIPLIER' => $c->getAttribute(\NumberFormatter::MULTIPLIER), + 'GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::GROUPING_SIZE), + 'ROUNDING_MODE' => $c->getAttribute(\NumberFormatter::ROUNDING_MODE), + 'ROUNDING_INCREMENT' => $c->getAttribute(\NumberFormatter::ROUNDING_INCREMENT), + 'FORMAT_WIDTH' => $c->getAttribute(\NumberFormatter::FORMAT_WIDTH), + 'PADDING_POSITION' => $c->getAttribute(\NumberFormatter::PADDING_POSITION), + 'SECONDARY_GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::SECONDARY_GROUPING_SIZE), + 'SIGNIFICANT_DIGITS_USED' => $c->getAttribute(\NumberFormatter::SIGNIFICANT_DIGITS_USED), + 'MIN_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_SIGNIFICANT_DIGITS), + 'MAX_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_SIGNIFICANT_DIGITS), + 'LENIENT_PARSE' => $c->getAttribute(\NumberFormatter::LENIENT_PARSE), + ] + ), + Caster::PREFIX_VIRTUAL.'text_attributes' => new EnumStub( + [ + 'POSITIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_PREFIX), + 'POSITIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_SUFFIX), + 'NEGATIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_PREFIX), + 'NEGATIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_SUFFIX), + 'PADDING_CHARACTER' => $c->getTextAttribute(\NumberFormatter::PADDING_CHARACTER), + 'CURRENCY_CODE' => $c->getTextAttribute(\NumberFormatter::CURRENCY_CODE), + 'DEFAULT_RULESET' => $c->getTextAttribute(\NumberFormatter::DEFAULT_RULESET), + 'PUBLIC_RULESETS' => $c->getTextAttribute(\NumberFormatter::PUBLIC_RULESETS), + ] + ), + Caster::PREFIX_VIRTUAL.'symbols' => new EnumStub( + [ + 'DECIMAL_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL), + 'GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL), + 'PATTERN_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::PATTERN_SEPARATOR_SYMBOL), + 'PERCENT_SYMBOL' => $c->getSymbol(\NumberFormatter::PERCENT_SYMBOL), + 'ZERO_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::ZERO_DIGIT_SYMBOL), + 'DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::DIGIT_SYMBOL), + 'MINUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::MINUS_SIGN_SYMBOL), + 'PLUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::PLUS_SIGN_SYMBOL), + 'CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::CURRENCY_SYMBOL), + 'INTL_CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL), + 'MONETARY_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_SEPARATOR_SYMBOL), + 'EXPONENTIAL_SYMBOL' => $c->getSymbol(\NumberFormatter::EXPONENTIAL_SYMBOL), + 'PERMILL_SYMBOL' => $c->getSymbol(\NumberFormatter::PERMILL_SYMBOL), + 'PAD_ESCAPE_SYMBOL' => $c->getSymbol(\NumberFormatter::PAD_ESCAPE_SYMBOL), + 'INFINITY_SYMBOL' => $c->getSymbol(\NumberFormatter::INFINITY_SYMBOL), + 'NAN_SYMBOL' => $c->getSymbol(\NumberFormatter::NAN_SYMBOL), + 'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL), + 'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL), + ] + ), + ]; + + return self::castError($c, $a); + } + + public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, $isNested) + { + $a += [ + Caster::PREFIX_VIRTUAL.'display_name' => $c->getDisplayName(), + Caster::PREFIX_VIRTUAL.'id' => $c->getID(), + Caster::PREFIX_VIRTUAL.'raw_offset' => $c->getRawOffset(), + ]; + + if ($c->useDaylightTime()) { + $a += [ + Caster::PREFIX_VIRTUAL.'dst_savings' => $c->getDSTSavings(), + ]; + } + + return self::castError($c, $a); + } + + public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, $isNested, $filter = 0) + { + $a += [ + Caster::PREFIX_VIRTUAL.'type' => $c->getType(), + Caster::PREFIX_VIRTUAL.'first_day_of_week' => $c->getFirstDayOfWeek(), + Caster::PREFIX_VIRTUAL.'minimal_days_in_first_week' => $c->getMinimalDaysInFirstWeek(), + Caster::PREFIX_VIRTUAL.'repeated_wall_time_option' => $c->getRepeatedWallTimeOption(), + Caster::PREFIX_VIRTUAL.'skipped_wall_time_option' => $c->getSkippedWallTimeOption(), + Caster::PREFIX_VIRTUAL.'time' => $c->getTime(), + Caster::PREFIX_VIRTUAL.'in_daylight_time' => $c->inDaylightTime(), + Caster::PREFIX_VIRTUAL.'is_lenient' => $c->isLenient(), + Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(), + ]; + + return self::castError($c, $a); + } + + public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, $isNested, $filter = 0) + { + $a += [ + Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), + Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(), + Caster::PREFIX_VIRTUAL.'calendar' => $c->getCalendar(), + Caster::PREFIX_VIRTUAL.'time_zone_id' => $c->getTimeZoneId(), + Caster::PREFIX_VIRTUAL.'time_type' => $c->getTimeType(), + Caster::PREFIX_VIRTUAL.'date_type' => $c->getDateType(), + Caster::PREFIX_VIRTUAL.'calendar_object' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getCalendarObject()) : $c->getCalendarObject(), + Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(), + ]; + + return self::castError($c, $a); + } + + private static function castError($c, array $a): array + { + if ($errorCode = $c->getErrorCode()) { + $a += [ + Caster::PREFIX_VIRTUAL.'error_code' => $errorCode, + Caster::PREFIX_VIRTUAL.'error_message' => $c->getErrorMessage(), + ]; + } + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Caster/LinkStub.php b/vendor/symfony/var-dumper/Caster/LinkStub.php index b589b502d4cef8a8a45a34c3b8fc165693ce1647..6360716d7bc52a8cf3ed857f62a94c2d9aec66f8 100644 --- a/vendor/symfony/var-dumper/Caster/LinkStub.php +++ b/vendor/symfony/var-dumper/Caster/LinkStub.php @@ -23,7 +23,7 @@ class LinkStub extends ConstStub private static $vendorRoots; private static $composerRoots; - public function __construct($label, $line = 0, $href = null) + public function __construct($label, int $line = 0, $href = null) { $this->value = $label; @@ -63,7 +63,7 @@ public function __construct($label, $line = 0, $href = null) } } - private function getComposerRoot($file, &$inVendor) + private function getComposerRoot(string $file, bool &$inVendor) { if (null === self::$vendorRoots) { self::$vendorRoots = []; @@ -71,7 +71,7 @@ private function getComposerRoot($file, &$inVendor) foreach (get_declared_classes() as $class) { if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { $r = new \ReflectionClass($class); - $v = \dirname(\dirname($r->getFileName())); + $v = \dirname($r->getFileName(), 2); if (file_exists($v.'/composer/installed.json')) { self::$vendorRoots[] = $v.\DIRECTORY_SEPARATOR; } diff --git a/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/vendor/symfony/var-dumper/Caster/MemcachedCaster.php new file mode 100644 index 0000000000000000000000000000000000000000..942eecb11fb4deba876707417980cde9ea394807 --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/MemcachedCaster.php @@ -0,0 +1,81 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Jan Schädlich <jan.schaedlich@sensiolabs.de> + * + * @final since Symfony 4.4 + */ +class MemcachedCaster +{ + private static $optionConstants; + private static $defaultOptions; + + public static function castMemcached(\Memcached $c, array $a, Stub $stub, $isNested) + { + $a += [ + Caster::PREFIX_VIRTUAL.'servers' => $c->getServerList(), + Caster::PREFIX_VIRTUAL.'options' => new EnumStub( + self::getNonDefaultOptions($c) + ), + ]; + + return $a; + } + + private static function getNonDefaultOptions(\Memcached $c): array + { + self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions(); + self::$optionConstants = self::$optionConstants ?? self::getOptionConstants(); + + $nonDefaultOptions = []; + foreach (self::$optionConstants as $constantKey => $value) { + if (self::$defaultOptions[$constantKey] !== $option = $c->getOption($value)) { + $nonDefaultOptions[$constantKey] = $option; + } + } + + return $nonDefaultOptions; + } + + private static function discoverDefaultOptions(): array + { + $defaultMemcached = new \Memcached(); + $defaultMemcached->addServer('127.0.0.1', 11211); + + $defaultOptions = []; + self::$optionConstants = self::$optionConstants ?? self::getOptionConstants(); + + foreach (self::$optionConstants as $constantKey => $value) { + $defaultOptions[$constantKey] = $defaultMemcached->getOption($value); + } + + return $defaultOptions; + } + + private static function getOptionConstants(): array + { + $reflectedMemcached = new \ReflectionClass(\Memcached::class); + + $optionConstants = []; + foreach ($reflectedMemcached->getConstants() as $constantKey => $value) { + if (0 === strpos($constantKey, 'OPT_')) { + $optionConstants[$constantKey] = $value; + } + } + + return $optionConstants; + } +} diff --git a/vendor/symfony/var-dumper/Caster/MongoCaster.php b/vendor/symfony/var-dumper/Caster/MongoCaster.php deleted file mode 100644 index 98f1b8e25d2884eb6f6cd5027e7b4c1d42ee22f1..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Caster/MongoCaster.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -@trigger_error('The '.__NAMESPACE__.'\MongoCaster class is deprecated since Symfony 3.4 and will be removed in 4.0.', \E_USER_DEPRECATED); - -/** - * Casts classes from the MongoDb extension to array representation. - * - * @author Nicolas Grekas <p@tchwork.com> - * - * @deprecated since version 3.4, to be removed in 4.0. - */ -class MongoCaster -{ - public static function castCursor(\MongoCursorInterface $cursor, array $a, Stub $stub, $isNested) - { - if ($info = $cursor->info()) { - foreach ($info as $k => $v) { - $a[Caster::PREFIX_VIRTUAL.$k] = $v; - } - } - $a[Caster::PREFIX_VIRTUAL.'dead'] = $cursor->dead(); - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/PdoCaster.php b/vendor/symfony/var-dumper/Caster/PdoCaster.php index 8af51829a93fbf0d127c8826d5f8312cccc87585..47b0a62b764e690965aa86df1cba7a8443a2129c 100644 --- a/vendor/symfony/var-dumper/Caster/PdoCaster.php +++ b/vendor/symfony/var-dumper/Caster/PdoCaster.php @@ -17,10 +17,12 @@ * Casts PDO related classes to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class PdoCaster { - private static $pdoAttributes = [ + private const PDO_ATTRIBUTES = [ 'CASE' => [ \PDO::CASE_LOWER => 'LOWER', \PDO::CASE_NATURAL => 'NATURAL', @@ -63,7 +65,7 @@ public static function castPdo(\PDO $c, array $a, Stub $stub, $isNested) $errmode = $c->getAttribute(\PDO::ATTR_ERRMODE); $c->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - foreach (self::$pdoAttributes as $k => $v) { + foreach (self::PDO_ATTRIBUTES as $k => $v) { if (!isset($k[0])) { $k = $v; $v = []; diff --git a/vendor/symfony/var-dumper/Caster/PgSqlCaster.php b/vendor/symfony/var-dumper/Caster/PgSqlCaster.php index fe1f0cc8d9acd10659696ae79eb6421d8115a6b0..3097c5184ce4db6bb7de42e3ed8ac34a868fc5c2 100644 --- a/vendor/symfony/var-dumper/Caster/PgSqlCaster.php +++ b/vendor/symfony/var-dumper/Caster/PgSqlCaster.php @@ -17,10 +17,12 @@ * Casts pqsql resources to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class PgSqlCaster { - private static $paramCodes = [ + private const PARAM_CODES = [ 'server_encoding', 'client_encoding', 'is_superuser', @@ -33,7 +35,7 @@ class PgSqlCaster 'standard_conforming_strings', ]; - private static $transactionStatus = [ + private const TRANSACTION_STATUS = [ \PGSQL_TRANSACTION_IDLE => 'PGSQL_TRANSACTION_IDLE', \PGSQL_TRANSACTION_ACTIVE => 'PGSQL_TRANSACTION_ACTIVE', \PGSQL_TRANSACTION_INTRANS => 'PGSQL_TRANSACTION_INTRANS', @@ -41,7 +43,7 @@ class PgSqlCaster \PGSQL_TRANSACTION_UNKNOWN => 'PGSQL_TRANSACTION_UNKNOWN', ]; - private static $resultStatus = [ + private const RESULT_STATUS = [ \PGSQL_EMPTY_QUERY => 'PGSQL_EMPTY_QUERY', \PGSQL_COMMAND_OK => 'PGSQL_COMMAND_OK', \PGSQL_TUPLES_OK => 'PGSQL_TUPLES_OK', @@ -52,7 +54,7 @@ class PgSqlCaster \PGSQL_FATAL_ERROR => 'PGSQL_FATAL_ERROR', ]; - private static $diagCodes = [ + private const DIAG_CODES = [ 'severity' => \PGSQL_DIAG_SEVERITY, 'sqlstate' => \PGSQL_DIAG_SQLSTATE, 'message' => \PGSQL_DIAG_MESSAGE_PRIMARY, @@ -81,8 +83,8 @@ public static function castLink($link, array $a, Stub $stub, $isNested) $a['busy'] = pg_connection_busy($link); $a['transaction'] = pg_transaction_status($link); - if (isset(self::$transactionStatus[$a['transaction']])) { - $a['transaction'] = new ConstStub(self::$transactionStatus[$a['transaction']], $a['transaction']); + if (isset(self::TRANSACTION_STATUS[$a['transaction']])) { + $a['transaction'] = new ConstStub(self::TRANSACTION_STATUS[$a['transaction']], $a['transaction']); } $a['pid'] = pg_get_pid($link); @@ -94,7 +96,7 @@ public static function castLink($link, array $a, Stub $stub, $isNested) $a['options'] = pg_options($link); $a['version'] = pg_version($link); - foreach (self::$paramCodes as $v) { + foreach (self::PARAM_CODES as $v) { if (false !== $s = pg_parameter_status($link, $v)) { $a['param'][$v] = $s; } @@ -110,13 +112,13 @@ public static function castResult($result, array $a, Stub $stub, $isNested) { $a['num rows'] = pg_num_rows($result); $a['status'] = pg_result_status($result); - if (isset(self::$resultStatus[$a['status']])) { - $a['status'] = new ConstStub(self::$resultStatus[$a['status']], $a['status']); + if (isset(self::RESULT_STATUS[$a['status']])) { + $a['status'] = new ConstStub(self::RESULT_STATUS[$a['status']], $a['status']); } $a['command-completion tag'] = pg_result_status($result, \PGSQL_STATUS_STRING); if (-1 === $a['num rows']) { - foreach (self::$diagCodes as $k => $v) { + foreach (self::DIAG_CODES as $k => $v) { $a['error'][$k] = pg_result_error_field($result, $v); } } diff --git a/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php b/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php new file mode 100644 index 0000000000000000000000000000000000000000..ec02f8137ddb7ae2e8d67530730d547655b463e3 --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php @@ -0,0 +1,33 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use ProxyManager\Proxy\ProxyInterface; +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 + */ +class ProxyManagerCaster +{ + public static function castProxy(ProxyInterface $c, array $a, Stub $stub, $isNested) + { + if ($parent = get_parent_class($c)) { + $stub->class .= ' - '.$parent; + } + $stub->class .= '@proxy'; + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Caster/RedisCaster.php b/vendor/symfony/var-dumper/Caster/RedisCaster.php index 1e2fb3991629b68a5413186d704abab0180908ed..bd877cb3eb1dee68982ef131dd315101de49068b 100644 --- a/vendor/symfony/var-dumper/Caster/RedisCaster.php +++ b/vendor/symfony/var-dumper/Caster/RedisCaster.php @@ -17,51 +17,58 @@ * Casts Redis class from ext-redis to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class RedisCaster { - private static $serializer = [ + private const SERIALIZERS = [ \Redis::SERIALIZER_NONE => 'NONE', \Redis::SERIALIZER_PHP => 'PHP', 2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY ]; + private const MODES = [ + \Redis::ATOMIC => 'ATOMIC', + \Redis::MULTI => 'MULTI', + \Redis::PIPELINE => 'PIPELINE', + ]; + + private const COMPRESSION_MODES = [ + 0 => 'NONE', // Redis::COMPRESSION_NONE + 1 => 'LZF', // Redis::COMPRESSION_LZF + ]; + + private const FAILOVER_OPTIONS = [ + \RedisCluster::FAILOVER_NONE => 'NONE', + \RedisCluster::FAILOVER_ERROR => 'ERROR', + \RedisCluster::FAILOVER_DISTRIBUTE => 'DISTRIBUTE', + \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES', + ]; + public static function castRedis(\Redis $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; - if (\defined('HHVM_VERSION_ID')) { - if (isset($a[Caster::PREFIX_PROTECTED.'serializer'])) { - $ser = $a[Caster::PREFIX_PROTECTED.'serializer']; - $a[Caster::PREFIX_PROTECTED.'serializer'] = isset(self::$serializer[$ser]) ? new ConstStub(self::$serializer[$ser], $ser) : $ser; - } - - return $a; - } - if (!$connected = $c->isConnected()) { return $a + [ $prefix.'isConnected' => $connected, ]; } - $ser = $c->getOption(\Redis::OPT_SERIALIZER); - $retry = \defined('Redis::OPT_SCAN') ? $c->getOption(\Redis::OPT_SCAN) : 0; + $mode = $c->getMode(); return $a + [ $prefix.'isConnected' => $connected, $prefix.'host' => $c->getHost(), $prefix.'port' => $c->getPort(), $prefix.'auth' => $c->getAuth(), + $prefix.'mode' => isset(self::MODES[$mode]) ? new ConstStub(self::MODES[$mode], $mode) : $mode, $prefix.'dbNum' => $c->getDbNum(), $prefix.'timeout' => $c->getTimeout(), + $prefix.'lastError' => $c->getLastError(), $prefix.'persistentId' => $c->getPersistentID(), - $prefix.'options' => new EnumStub([ - 'READ_TIMEOUT' => $c->getOption(\Redis::OPT_READ_TIMEOUT), - 'SERIALIZER' => isset(self::$serializer[$ser]) ? new ConstStub(self::$serializer[$ser], $ser) : $ser, - 'PREFIX' => $c->getOption(\Redis::OPT_PREFIX), - 'SCAN' => new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry), - ]), + $prefix.'options' => self::getRedisOptions($c), ]; } @@ -72,6 +79,74 @@ public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, $isN return $a + [ $prefix.'hosts' => $c->_hosts(), $prefix.'function' => ClassStub::wrapCallable($c->_function()), + $prefix.'lastError' => $c->getLastError(), + $prefix.'options' => self::getRedisOptions($c), + ]; + } + + public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, $isNested) + { + $prefix = Caster::PREFIX_VIRTUAL; + $failover = $c->getOption(\RedisCluster::OPT_SLAVE_FAILOVER); + + $a += [ + $prefix.'_masters' => $c->_masters(), + $prefix.'_redir' => $c->_redir(), + $prefix.'mode' => new ConstStub($c->getMode() ? 'MULTI' : 'ATOMIC', $c->getMode()), + $prefix.'lastError' => $c->getLastError(), + $prefix.'options' => self::getRedisOptions($c, [ + 'SLAVE_FAILOVER' => isset(self::FAILOVER_OPTIONS[$failover]) ? new ConstStub(self::FAILOVER_OPTIONS[$failover], $failover) : $failover, + ]), ]; + + return $a; + } + + /** + * @param \Redis|\RedisArray|\RedisCluster $redis + */ + private static function getRedisOptions($redis, array $options = []): EnumStub + { + $serializer = $redis->getOption(\Redis::OPT_SERIALIZER); + if (\is_array($serializer)) { + foreach ($serializer as &$v) { + if (isset(self::SERIALIZERS[$v])) { + $v = new ConstStub(self::SERIALIZERS[$v], $v); + } + } + } elseif (isset(self::SERIALIZERS[$serializer])) { + $serializer = new ConstStub(self::SERIALIZERS[$serializer], $serializer); + } + + $compression = \defined('Redis::OPT_COMPRESSION') ? $redis->getOption(\Redis::OPT_COMPRESSION) : 0; + if (\is_array($compression)) { + foreach ($compression as &$v) { + if (isset(self::COMPRESSION_MODES[$v])) { + $v = new ConstStub(self::COMPRESSION_MODES[$v], $v); + } + } + } elseif (isset(self::COMPRESSION_MODES[$compression])) { + $compression = new ConstStub(self::COMPRESSION_MODES[$compression], $compression); + } + + $retry = \defined('Redis::OPT_SCAN') ? $redis->getOption(\Redis::OPT_SCAN) : 0; + if (\is_array($retry)) { + foreach ($retry as &$v) { + $v = new ConstStub($v ? 'RETRY' : 'NORETRY', $v); + } + } else { + $retry = new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry); + } + + $options += [ + 'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : 0, + 'READ_TIMEOUT' => $redis->getOption(\Redis::OPT_READ_TIMEOUT), + 'COMPRESSION' => $compression, + 'SERIALIZER' => $serializer, + 'PREFIX' => $redis->getOption(\Redis::OPT_PREFIX), + 'SCAN' => $retry, + ]; + + return new EnumStub($options); } } diff --git a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php index f19886172adbf6aafdb1e1d2e508a51d804b5f42..95c1dbf6ff1be586b61b55a732c12de63538d53a 100644 --- a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php @@ -17,10 +17,14 @@ * Casts Reflector related classes to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class ReflectionCaster { - private static $extraMap = [ + public const UNSET_CLOSURE_FILE_INFO = ['Closure' => __CLASS__.'::unsetClosureFileInfo']; + + private const EXTRA_MAP = [ 'docComment' => 'getDocComment', 'extension' => 'getExtensionName', 'isDisabled' => 'isDisabled', @@ -36,44 +40,46 @@ public static function castClosure(\Closure $c, array $a, Stub $stub, $isNested, $prefix = Caster::PREFIX_VIRTUAL; $c = new \ReflectionFunction($c); - $stub->class = 'Closure'; // HHVM generates unique class names for closures $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter); if (false === strpos($c->name, '{closure}')) { $stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name; unset($a[$prefix.'class']); } + unset($a[$prefix.'extra']); - if (isset($a[$prefix.'parameters'])) { - foreach ($a[$prefix.'parameters']->value as &$v) { - $param = $v; - $v = new EnumStub([]); - foreach (static::castParameter($param, [], $stub, true) as $k => $param) { - if ("\0" === $k[0]) { - $v->value[substr($k, 3)] = $param; - } - } - unset($v->value['position'], $v->value['isVariadic'], $v->value['byReference'], $v); - } + $stub->class .= self::getSignature($a); + + if ($f = $c->getFileName()) { + $stub->attr['file'] = $f; + $stub->attr['line'] = $c->getStartLine(); } - if (!($filter & Caster::EXCLUDE_VERBOSE) && $f = $c->getFileName()) { + unset($a[$prefix.'parameters']); + + if ($filter & Caster::EXCLUDE_VERBOSE) { + $stub->cut += ($c->getFileName() ? 2 : 0) + \count($a); + + return []; + } + + if ($f) { $a[$prefix.'file'] = new LinkStub($f, $c->getStartLine()); $a[$prefix.'line'] = $c->getStartLine().' to '.$c->getEndLine(); } - $prefix = Caster::PREFIX_DYNAMIC; - unset($a['name'], $a[$prefix.'this'], $a[$prefix.'parameter'], $a[Caster::PREFIX_VIRTUAL.'extra']); + return $a; + } + + public static function unsetClosureFileInfo(\Closure $c, array $a) + { + unset($a[Caster::PREFIX_VIRTUAL.'file'], $a[Caster::PREFIX_VIRTUAL.'line']); return $a; } public static function castGenerator(\Generator $c, array $a, Stub $stub, $isNested) { - if (!class_exists('ReflectionGenerator', false)) { - return $a; - } - // Cannot create ReflectionGenerator based on a terminated Generator try { $reflectionGenerator = new \ReflectionGenerator($c); @@ -90,11 +96,20 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, $isNes { $prefix = Caster::PREFIX_VIRTUAL; - $a += [ - $prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c, - $prefix.'allowsNull' => $c->allowsNull(), - $prefix.'isBuiltin' => $c->isBuiltin(), - ]; + if ($c instanceof \ReflectionNamedType || \PHP_VERSION_ID < 80000) { + $a += [ + $prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c, + $prefix.'allowsNull' => $c->allowsNull(), + $prefix.'isBuiltin' => $c->isBuiltin(), + ]; + } elseif ($c instanceof \ReflectionUnionType) { + $a[$prefix.'allowsNull'] = $c->allowsNull(); + self::addMap($a, $c, [ + 'types' => 'getTypes', + ]); + } else { + $a[$prefix.'allowsNull'] = $c->allowsNull(); + } return $a; } @@ -108,7 +123,7 @@ public static function castReflectionGenerator(\ReflectionGenerator $c, array $a } $function = $c->getFunction(); $frame = [ - 'class' => isset($function->class) ? $function->class : null, + 'class' => $function->class ?? null, 'type' => isset($function->class) ? ($function->isStatic() ? '::' : '->') : null, 'function' => $function->name, 'file' => $c->getExecutingFile(), @@ -126,9 +141,7 @@ public static function castReflectionGenerator(\ReflectionGenerator $c, array $a } else { $function = new FrameStub($frame, false, true); $function = ExceptionCaster::castFrameStub($function, [], $function, true); - $a[$prefix.'executing'] = new EnumStub([ - "\0~separator= \0".$frame['class'].$frame['type'].$frame['function'].'()' => $function[$prefix.'src'], - ]); + $a[$prefix.'executing'] = $function[$prefix.'src']; } $a[Caster::PREFIX_VIRTUAL.'closed'] = false; @@ -179,7 +192,7 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra if (isset($a[$prefix.'returnType'])) { $v = $a[$prefix.'returnType']; $v = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v; - $a[$prefix.'returnType'] = new ClassStub($a[$prefix.'returnType']->allowsNull() ? '?'.$v : $v, [class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '']); + $a[$prefix.'returnType'] = new ClassStub($a[$prefix.'returnType'] instanceof \ReflectionNamedType && $a[$prefix.'returnType']->allowsNull() && 'mixed' !== $v ? '?'.$v : $v, [class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '']); } if (isset($a[$prefix.'class'])) { $a[$prefix.'class'] = new ClassStub($a[$prefix.'class']); @@ -190,7 +203,7 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra foreach ($c->getParameters() as $v) { $k = '$'.$v->name; - if (method_exists($v, 'isVariadic') && $v->isVariadic()) { + if ($v->isVariadic()) { $k = '...'.$k; } if ($v->isPassedByReference()) { @@ -202,7 +215,7 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra $a[$prefix.'parameters'] = new EnumStub($a[$prefix.'parameters']); } - if ($v = $c->getStaticVariables()) { + if (!($filter & Caster::EXCLUDE_VERBOSE) && $v = $c->getStaticVariables()) { foreach ($v as $k => &$v) { if (\is_object($v)) { $a[$prefix.'use']['$'.$k] = new CutStub($v); @@ -218,9 +231,6 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra self::addExtra($a, $c); } - // Added by HHVM - unset($a[Caster::PREFIX_DYNAMIC.'static']); - return $a; } @@ -235,9 +245,6 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st { $prefix = Caster::PREFIX_VIRTUAL; - // Added by HHVM - unset($a['info']); - self::addMap($a, $c, [ 'position' => 'getPosition', 'isVariadic' => 'isVariadic', @@ -245,12 +252,8 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st 'allowsNull' => 'allowsNull', ]); - if (method_exists($c, 'getType')) { - if ($v = $c->getType()) { - $a[$prefix.'typeHint'] = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v; - } - } elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\x7F-\xFF][^ ]++)/', $c, $v)) { - $a[$prefix.'typeHint'] = $v[1]; + if ($v = $c->getType()) { + $a[$prefix.'typeHint'] = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v; } if (isset($a[$prefix.'typeHint'])) { @@ -262,17 +265,13 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st try { $a[$prefix.'default'] = $v = $c->getDefaultValue(); - if (method_exists($c, 'isDefaultValueConstant') && $c->isDefaultValueConstant()) { + if ($c->isDefaultValueConstant()) { $a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v); } if (null === $v) { unset($a[$prefix.'allowsNull']); } } catch (\ReflectionException $e) { - if (isset($a[$prefix.'typeHint']) && $c->allowsNull() && !class_exists('ReflectionNamedType', false)) { - $a[$prefix.'default'] = null; - unset($a[$prefix.'allowsNull']); - } } return $a; @@ -286,6 +285,13 @@ public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub return $a; } + public static function castReference(\ReflectionReference $c, array $a, Stub $stub, $isNested) + { + $a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId(); + + return $a; + } + public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, $isNested) { self::addMap($a, $c, [ @@ -314,7 +320,57 @@ public static function castZendExtension(\ReflectionZendExtension $c, array $a, return $a; } - private static function addExtra(&$a, \Reflector $c) + public static function getSignature(array $a) + { + $prefix = Caster::PREFIX_VIRTUAL; + $signature = ''; + + if (isset($a[$prefix.'parameters'])) { + foreach ($a[$prefix.'parameters']->value as $k => $param) { + $signature .= ', '; + if ($type = $param->getType()) { + if (!$type instanceof \ReflectionNamedType) { + $signature .= $type.' '; + } else { + if (!$param->isOptional() && $param->allowsNull() && 'mixed' !== $type->getName()) { + $signature .= '?'; + } + $signature .= substr(strrchr('\\'.$type->getName(), '\\'), 1).' '; + } + } + $signature .= $k; + + if (!$param->isDefaultValueAvailable()) { + continue; + } + $v = $param->getDefaultValue(); + $signature .= ' = '; + + if ($param->isDefaultValueConstant()) { + $signature .= substr(strrchr('\\'.$param->getDefaultValueConstantName(), '\\'), 1); + } elseif (null === $v) { + $signature .= 'null'; + } elseif (\is_array($v)) { + $signature .= $v ? '[…'.\count($v).']' : '[]'; + } elseif (\is_string($v)) { + $signature .= 10 > \strlen($v) && false === strpos($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'"; + } elseif (\is_bool($v)) { + $signature .= $v ? 'true' : 'false'; + } else { + $signature .= $v; + } + } + } + $signature = (empty($a[$prefix.'returnsReference']) ? '' : '&').'('.substr($signature, 2).')'; + + if (isset($a[$prefix.'returnType'])) { + $signature .= ': '.substr(strrchr('\\'.$a[$prefix.'returnType'], '\\'), 1); + } + + return $signature; + } + + private static function addExtra(array &$a, \Reflector $c) { $x = isset($a[Caster::PREFIX_VIRTUAL.'extra']) ? $a[Caster::PREFIX_VIRTUAL.'extra']->value : []; @@ -323,14 +379,14 @@ private static function addExtra(&$a, \Reflector $c) $x['line'] = $c->getStartLine().' to '.$c->getEndLine(); } - self::addMap($x, $c, self::$extraMap, ''); + self::addMap($x, $c, self::EXTRA_MAP, ''); if ($x) { $a[Caster::PREFIX_VIRTUAL.'extra'] = new EnumStub($x); } } - private static function addMap(&$a, \Reflector $c, $map, $prefix = Caster::PREFIX_VIRTUAL) + private static function addMap(array &$a, $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL) { foreach ($map as $k => $m) { if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) { diff --git a/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/vendor/symfony/var-dumper/Caster/ResourceCaster.php index eb11aee1f026412ef309c5362cfd90933e16ef42..5a7c4285252cbebaa7a0ff99719d6a6dec314584 100644 --- a/vendor/symfony/var-dumper/Caster/ResourceCaster.php +++ b/vendor/symfony/var-dumper/Caster/ResourceCaster.php @@ -17,6 +17,8 @@ * Casts common resource types to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class ResourceCaster { @@ -74,4 +76,30 @@ public static function castMysqlLink($h, array $a, Stub $stub, $isNested) return $a; } + + public static function castOpensslX509($h, array $a, Stub $stub, $isNested) + { + $stub->cut = -1; + $info = openssl_x509_parse($h, false); + + $pin = openssl_pkey_get_public($h); + $pin = openssl_pkey_get_details($pin)['key']; + $pin = \array_slice(explode("\n", $pin), 1, -2); + $pin = base64_decode(implode('', $pin)); + $pin = base64_encode(hash('sha256', $pin, true)); + + $a += [ + 'subject' => new EnumStub(array_intersect_key($info['subject'], ['organizationName' => true, 'commonName' => true])), + 'issuer' => new EnumStub(array_intersect_key($info['issuer'], ['organizationName' => true, 'commonName' => true])), + 'expiry' => new ConstStub(date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']), + 'fingerprint' => new EnumStub([ + 'md5' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'md5')), 2, ':', true)), + 'sha1' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha1')), 2, ':', true)), + 'sha256' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha256')), 2, ':', true)), + 'pin-sha256' => new ConstStub($pin), + ]), + ]; + + return $a; + } } diff --git a/vendor/symfony/var-dumper/Caster/SplCaster.php b/vendor/symfony/var-dumper/Caster/SplCaster.php index 360a1a416eafdb4233f01e8e4b30c0fe473fc2e7..5abc51a9f323d6082de2481cdd178c750d348ce4 100644 --- a/vendor/symfony/var-dumper/Caster/SplCaster.php +++ b/vendor/symfony/var-dumper/Caster/SplCaster.php @@ -17,10 +17,12 @@ * Casts SPL related classes to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class SplCaster { - private static $splFileObjectFlags = [ + private const SPL_FILE_OBJECT_FLAGS = [ \SplFileObject::DROP_NEW_LINE => 'DROP_NEW_LINE', \SplFileObject::READ_AHEAD => 'READ_AHEAD', \SplFileObject::SKIP_EMPTY => 'SKIP_EMPTY', @@ -167,7 +169,7 @@ public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, $ if (isset($a[$prefix.'flags'])) { $flagsArray = []; - foreach (self::$splFileObjectFlags as $value => $name) { + foreach (self::SPL_FILE_OBJECT_FLAGS as $value => $name) { if ($a[$prefix.'flags'] & $value) { $flagsArray[] = $name; } @@ -210,7 +212,14 @@ public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub return $a; } - private static function castSplArray($c, array $a, Stub $stub, $isNested) + public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, $isNested) + { + $a[Caster::PREFIX_VIRTUAL.'object'] = $c->get(); + + return $a; + } + + private static function castSplArray($c, array $a, Stub $stub, bool $isNested): array { $prefix = Caster::PREFIX_VIRTUAL; $flags = $c->getFlags(); diff --git a/vendor/symfony/var-dumper/Caster/StubCaster.php b/vendor/symfony/var-dumper/Caster/StubCaster.php index 9927d42610c18ca0c64dd6a089dcf78f57446727..b6332fb740f79f38ad9785af28c3ae15879edb55 100644 --- a/vendor/symfony/var-dumper/Caster/StubCaster.php +++ b/vendor/symfony/var-dumper/Caster/StubCaster.php @@ -17,6 +17,8 @@ * Casts a caster's Stub. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class StubCaster { diff --git a/vendor/symfony/var-dumper/Caster/SymfonyCaster.php b/vendor/symfony/var-dumper/Caster/SymfonyCaster.php index ae7134f55b2a1e2b9e133859662187e6d582ee6c..06f213ef0fd993b798851c25c22c678fcd181339 100644 --- a/vendor/symfony/var-dumper/Caster/SymfonyCaster.php +++ b/vendor/symfony/var-dumper/Caster/SymfonyCaster.php @@ -14,9 +14,12 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\VarDumper\Cloner\Stub; +/** + * @final since Symfony 4.4 + */ class SymfonyCaster { - private static $requestGetters = [ + private const REQUEST_GETTERS = [ 'pathInfo' => 'getPathInfo', 'requestUri' => 'getRequestUri', 'baseUrl' => 'getBaseUrl', @@ -29,8 +32,9 @@ public static function castRequest(Request $request, array $a, Stub $stub, $isNe { $clone = null; - foreach (self::$requestGetters as $prop => $getter) { - if (null === $a[Caster::PREFIX_PROTECTED.$prop]) { + foreach (self::REQUEST_GETTERS as $prop => $getter) { + $key = Caster::PREFIX_PROTECTED.$prop; + if (\array_key_exists($key, $a) && null === $a[$key]) { if (null === $clone) { $clone = clone $request; } @@ -40,4 +44,26 @@ public static function castRequest(Request $request, array $a, Stub $stub, $isNe return $a; } + + public static function castHttpClient($client, array $a, Stub $stub, $isNested) + { + $multiKey = sprintf("\0%s\0multi", \get_class($client)); + if (isset($a[$multiKey])) { + $a[$multiKey] = new CutStub($a[$multiKey]); + } + + return $a; + } + + public static function castHttpClientResponse($response, array $a, Stub $stub, $isNested) + { + $stub->cut += \count($a); + $a = []; + + foreach ($response->getInfo() as $k => $v) { + $a[Caster::PREFIX_VIRTUAL.$k] = $v; + } + + return $a; + } } diff --git a/vendor/symfony/var-dumper/Caster/TraceStub.php b/vendor/symfony/var-dumper/Caster/TraceStub.php index 59548acaee61c8dbd93ee8492c4224ea36113186..5eea1c876680f3e8751be231c7d4b27fde4b3e9e 100644 --- a/vendor/symfony/var-dumper/Caster/TraceStub.php +++ b/vendor/symfony/var-dumper/Caster/TraceStub.php @@ -25,7 +25,7 @@ class TraceStub extends Stub public $sliceLength; public $numberingOffset; - public function __construct(array $trace, $keepArgs = true, $sliceOffset = 0, $sliceLength = null, $numberingOffset = 0) + public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) { $this->value = $trace; $this->keepArgs = $keepArgs; diff --git a/vendor/symfony/var-dumper/Caster/UuidCaster.php b/vendor/symfony/var-dumper/Caster/UuidCaster.php new file mode 100644 index 0000000000000000000000000000000000000000..b102774571f3491a485e14ce36f6399c15927e77 --- /dev/null +++ b/vendor/symfony/var-dumper/Caster/UuidCaster.php @@ -0,0 +1,30 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Ramsey\Uuid\UuidInterface; +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Grégoire Pineau <lyrixx@lyrixx.info> + */ +final class UuidCaster +{ + public static function castRamseyUuid(UuidInterface $c, array $a, Stub $stub, bool $isNested): array + { + $a += [ + Caster::PREFIX_VIRTUAL.'uuid' => (string) $c, + ]; + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php index 3ae9ec0ba19a03eda7bbc605b68cf0f780b6ea41..19bf6a3d5e1b5f42d3d7f894e9292d9863620e86 100644 --- a/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php +++ b/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php @@ -16,10 +16,12 @@ * Casts XmlReader class to array representation. * * @author Baptiste Clavié <clavie.b@gmail.com> + * + * @final since Symfony 4.4 */ class XmlReaderCaster { - private static $nodeTypes = [ + private const NODE_TYPES = [ \XMLReader::NONE => 'NONE', \XMLReader::ELEMENT => 'ELEMENT', \XMLReader::ATTRIBUTE => 'ATTRIBUTE', @@ -46,7 +48,7 @@ public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, $ $info = [ 'localName' => $reader->localName, 'prefix' => $reader->prefix, - 'nodeType' => new ConstStub(self::$nodeTypes[$reader->nodeType], $reader->nodeType), + 'nodeType' => new ConstStub(self::NODE_TYPES[$reader->nodeType], $reader->nodeType), 'depth' => $reader->depth, 'isDefault' => $reader->isDefault, 'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement, diff --git a/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php b/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php index 99c1486483c074a8f2c5b24e210ea52919865bfe..455fc065b8a72de7fdd06dc86637dbcd4c20ce01 100644 --- a/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php +++ b/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php @@ -17,10 +17,12 @@ * Casts XML resources to array representation. * * @author Nicolas Grekas <p@tchwork.com> + * + * @final since Symfony 4.4 */ class XmlResourceCaster { - private static $xmlErrors = [ + private const XML_ERRORS = [ \XML_ERROR_NONE => 'XML_ERROR_NONE', \XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY', \XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX', @@ -52,8 +54,8 @@ public static function castXml($h, array $a, Stub $stub, $isNested) $a['current_line_number'] = xml_get_current_line_number($h); $a['error_code'] = xml_get_error_code($h); - if (isset(self::$xmlErrors[$a['error_code']])) { - $a['error_code'] = new ConstStub(self::$xmlErrors[$a['error_code']], $a['error_code']); + if (isset(self::XML_ERRORS[$a['error_code']])) { + $a['error_code'] = new ConstStub(self::XML_ERRORS[$a['error_code']], $a['error_code']); } return $a; diff --git a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php index 76b55b478bf70c3ced2150143b17ebd69052ada6..178237905e37dc90e89acf6445e5ecc14b946dd6 100644 --- a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php @@ -38,6 +38,7 @@ abstract class AbstractCloner implements ClonerInterface 'ReflectionMethod' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castMethod'], 'ReflectionParameter' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castParameter'], 'ReflectionProperty' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castProperty'], + 'ReflectionReference' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReference'], 'ReflectionExtension' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castExtension'], 'ReflectionZendExtension' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castZendExtension'], @@ -70,18 +71,29 @@ abstract class AbstractCloner implements ClonerInterface 'DOMProcessingInstruction' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castProcessingInstruction'], 'DOMXPath' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castXPath'], - 'XmlReader' => ['Symfony\Component\VarDumper\Caster\XmlReaderCaster', 'castXmlReader'], + 'XMLReader' => ['Symfony\Component\VarDumper\Caster\XmlReaderCaster', 'castXmlReader'], 'ErrorException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castErrorException'], 'Exception' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castException'], 'Error' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castError'], 'Symfony\Component\DependencyInjection\ContainerInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], + 'Symfony\Component\EventDispatcher\EventDispatcherInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], + 'Symfony\Component\HttpClient\CurlHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], + 'Symfony\Component\HttpClient\NativeHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], + 'Symfony\Component\HttpClient\Response\CurlResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], + 'Symfony\Component\HttpClient\Response\NativeResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], 'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'], 'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'], 'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'], 'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'], - 'Symfony\Component\Debug\Exception\SilencedErrorContext' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'], + 'Symfony\Component\VarDumper\Cloner\AbstractCloner' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], + 'Symfony\Component\ErrorHandler\Exception\SilencedErrorContext' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'], + 'Imagine\Image\ImageInterface' => ['Symfony\Component\VarDumper\Caster\ImagineCaster', 'castImage'], + + 'Ramsey\Uuid\UuidInterface' => ['Symfony\Component\VarDumper\Caster\UuidCaster', 'castRamseyUuid'], + + 'ProxyManager\Proxy\ProxyInterface' => ['Symfony\Component\VarDumper\Caster\ProxyManagerCaster', 'castProxy'], 'PHPUnit_Framework_MockObject_MockObject' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], 'PHPUnit\Framework\MockObject\MockObject' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], 'PHPUnit\Framework\MockObject\Stub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], @@ -106,23 +118,41 @@ abstract class AbstractCloner implements ClonerInterface 'SplObjectStorage' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castObjectStorage'], 'SplPriorityQueue' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'], 'OuterIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castOuterIterator'], - - 'MongoCursorInterface' => ['Symfony\Component\VarDumper\Caster\MongoCaster', 'castCursor'], + 'WeakReference' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakReference'], 'Redis' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'], 'RedisArray' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'], + 'RedisCluster' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisCluster'], 'DateTimeInterface' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castDateTime'], 'DateInterval' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castInterval'], 'DateTimeZone' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castTimeZone'], 'DatePeriod' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castPeriod'], + 'GMP' => ['Symfony\Component\VarDumper\Caster\GmpCaster', 'castGmp'], + + 'MessageFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castMessageFormatter'], + 'NumberFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castNumberFormatter'], + 'IntlTimeZone' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlTimeZone'], + 'IntlCalendar' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlCalendar'], + 'IntlDateFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlDateFormatter'], + + 'Memcached' => ['Symfony\Component\VarDumper\Caster\MemcachedCaster', 'castMemcached'], + + 'Ds\Collection' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castCollection'], + 'Ds\Map' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castMap'], + 'Ds\Pair' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPair'], + 'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'], + 'CurlHandle' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'], ':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'], ':dba' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'], ':dba persistent' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'], + + 'GdImage' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'], ':gd' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'], + ':mysql link' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castMysqlLink'], ':pgsql large object' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLargeObject'], ':pgsql link' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'], @@ -130,15 +160,20 @@ abstract class AbstractCloner implements ClonerInterface ':pgsql result' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castResult'], ':process' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castProcess'], ':stream' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStream'], + + 'OpenSSLCertificate' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castOpensslX509'], + ':OpenSSL X.509' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castOpensslX509'], + ':persistent stream' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStream'], ':stream-context' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStreamContext'], + + 'XmlParser' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'], ':xml' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'], ]; protected $maxItems = 2500; protected $maxString = -1; protected $minDepth = 1; - protected $useExt; private $casters = []; private $prevErrorHandler; @@ -156,7 +191,6 @@ public function __construct(array $casters = null) $casters = static::$defaultCasters; } $this->addCasters($casters); - $this->useExt = \extension_loaded('symfony_debug'); } /** @@ -172,7 +206,7 @@ public function __construct(array $casters = null) public function addCasters(array $casters) { foreach ($casters as $type => $callback) { - $this->casters[strtolower($type)][] = \is_string($callback) && false !== strpos($callback, '::') ? explode('::', $callback, 2) : $callback; + $this->casters[$type][] = $callback; } } @@ -224,7 +258,7 @@ public function cloneVar($var, $filter = 0) } if ($this->prevErrorHandler) { - return \call_user_func($this->prevErrorHandler, $type, $msg, $file, $line, $context); + return ($this->prevErrorHandler)($type, $msg, $file, $line, $context); } return false; @@ -257,7 +291,6 @@ abstract protected function doClone($var); /** * Casts an object to an array representation. * - * @param Stub $stub The Stub for the casted object * @param bool $isNested True if the object is nested in the dumped structure * * @return array The object casted as array @@ -267,29 +300,36 @@ protected function castObject(Stub $stub, $isNested) $obj = $stub->value; $class = $stub->class; - if ((\PHP_VERSION_ID >= 80000 || (isset($class[15]) && "\0" === $class[15])) && false !== strpos($class, "@anonymous\0")) { - $stub->class = \PHP_VERSION_ID < 80000 ? (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous' : get_debug_type($obj); + if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : false !== strpos($class, "@anonymous\0")) { + $stub->class = get_debug_type($obj); } if (isset($this->classInfo[$class])) { - list($i, $parents, $hasDebugInfo) = $this->classInfo[$class]; + [$i, $parents, $hasDebugInfo, $fileInfo] = $this->classInfo[$class]; } else { $i = 2; - $parents = [strtolower($class)]; + $parents = [$class]; $hasDebugInfo = method_exists($class, '__debugInfo'); foreach (class_parents($class) as $p) { - $parents[] = strtolower($p); + $parents[] = $p; ++$i; } foreach (class_implements($class) as $p) { - $parents[] = strtolower($p); + $parents[] = $p; ++$i; } $parents[] = '*'; - $this->classInfo[$class] = [$i, $parents, $hasDebugInfo]; + $r = new \ReflectionClass($class); + $fileInfo = $r->isInternal() || $r->isSubclassOf(Stub::class) ? [] : [ + 'file' => $r->getFileName(), + 'line' => $r->getStartLine(), + ]; + + $this->classInfo[$class] = [$i, $parents, $hasDebugInfo, $fileInfo]; } + $stub->attr += $fileInfo; $a = Caster::castObject($obj, $class, $hasDebugInfo, $stub->class); try { @@ -310,7 +350,6 @@ protected function castObject(Stub $stub, $isNested) /** * Casts a resource to an array representation. * - * @param Stub $stub The Stub for the casted resource * @param bool $isNested True if the object is nested in the dumped structure * * @return array The resource casted as array diff --git a/vendor/symfony/var-dumper/Cloner/Cursor.php b/vendor/symfony/var-dumper/Cloner/Cursor.php index 5b0542f6c20cefdad75c7a93f483bce546a85819..1fd796d675008c69d9163f514bad771d3345dfeb 100644 --- a/vendor/symfony/var-dumper/Cloner/Cursor.php +++ b/vendor/symfony/var-dumper/Cloner/Cursor.php @@ -18,10 +18,10 @@ */ class Cursor { - const HASH_INDEXED = Stub::ARRAY_INDEXED; - const HASH_ASSOC = Stub::ARRAY_ASSOC; - const HASH_OBJECT = Stub::TYPE_OBJECT; - const HASH_RESOURCE = Stub::TYPE_RESOURCE; + public const HASH_INDEXED = Stub::ARRAY_INDEXED; + public const HASH_ASSOC = Stub::ARRAY_ASSOC; + public const HASH_OBJECT = Stub::TYPE_OBJECT; + public const HASH_RESOURCE = Stub::TYPE_RESOURCE; public $depth = 0; public $refIndex = 0; diff --git a/vendor/symfony/var-dumper/Cloner/Data.php b/vendor/symfony/var-dumper/Cloner/Data.php index 3973720794d94e2a9ad2c0b36348899470418002..21adb2364a1afef4c64219490d28d06ae8948a89 100644 --- a/vendor/symfony/var-dumper/Cloner/Data.php +++ b/vendor/symfony/var-dumper/Cloner/Data.php @@ -12,6 +12,7 @@ namespace Symfony\Component\VarDumper\Cloner; use Symfony\Component\VarDumper\Caster\Caster; +use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; /** * @author Nicolas Grekas <p@tchwork.com> @@ -24,6 +25,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate private $maxDepth = 20; private $maxItemsPerDepth = -1; private $useRefHandles = -1; + private $context = []; /** * @param array $data An array as returned by ClonerInterface::cloneVar() @@ -106,20 +108,24 @@ public function getValue($recursive = false) return $children; } + /** + * @return int + */ public function count() { return \count($this->getValue()); } + /** + * @return \Traversable + */ public function getIterator() { if (!\is_array($value = $this->getValue())) { throw new \LogicException(sprintf('"%s" object holds non-iterable type "%s".', self::class, \gettype($value))); } - foreach ($value as $k => $v) { - yield $k => $v; - } + yield from $value; } public function __get($key) @@ -133,11 +139,17 @@ public function __get($key) return null; } + /** + * @return bool + */ public function __isset($key) { return null !== $this->seek($key); } + /** + * @return bool + */ public function offsetExists($key) { return $this->__isset($key); @@ -158,6 +170,9 @@ public function offsetUnset($key) throw new \BadMethodCallException(self::class.' objects are immutable.'); } + /** + * @return string + */ public function __toString() { $value = $this->getValue(); @@ -169,18 +184,6 @@ public function __toString() return sprintf('%s (count=%d)', $this->getType(), \count($value)); } - /** - * @return array The raw data structure - * - * @deprecated since version 3.3. Use array or object access instead. - */ - public function getRawData() - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__)); - - return $this->data; - } - /** * Returns a depth limited clone of $this. * @@ -226,6 +229,17 @@ public function withRefHandles($useRefHandles) return $data; } + /** + * @return static + */ + public function withContext(array $context) + { + $data = clone $this; + $data->context = $context; + + return $data; + } + /** * Seeks to a specific key in nested data structures. * @@ -280,18 +294,26 @@ public function seek($key) public function dump(DumperInterface $dumper) { $refs = [0]; - $this->dumpItem($dumper, new Cursor(), $refs, $this->data[$this->position][$this->key]); + $cursor = new Cursor(); + + if ($cursor->attr = $this->context[SourceContextProvider::class] ?? []) { + $cursor->attr['if_links'] = true; + $cursor->hashType = -1; + $dumper->dumpScalar($cursor, 'default', '^'); + $cursor->attr = ['if_links' => true]; + $dumper->dumpScalar($cursor, 'default', ' '); + $cursor->hashType = 0; + } + + $this->dumpItem($dumper, $cursor, $refs, $this->data[$this->position][$this->key]); } /** * Depth-first dumping of items. * - * @param DumperInterface $dumper The dumper being used for dumping - * @param Cursor $cursor A cursor used for tracking dumper state position - * @param array &$refs A map of all references discovered while dumping - * @param mixed $item A Stub object or the original value being dumped + * @param mixed $item A Stub object or the original value being dumped */ - private function dumpItem($dumper, $cursor, &$refs, $item) + private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, $item) { $cursor->refIndex = 0; $cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0; @@ -313,7 +335,7 @@ private function dumpItem($dumper, $cursor, &$refs, $item) } $cursor->hardRefTo = $refs[$r]; $cursor->hardRefHandle = $this->useRefHandles & $item->handle; - $cursor->hardRefCount = $item->refCount; + $cursor->hardRefCount = 0 < $item->handle ? $item->refCount : 0; } $cursor->attr = $item->attr; $type = $item->class ?: \gettype($item->value); @@ -389,17 +411,9 @@ private function dumpItem($dumper, $cursor, &$refs, $item) /** * Dumps children of hash structures. * - * @param DumperInterface $dumper - * @param Cursor $parentCursor The cursor of the parent hash - * @param array &$refs A map of all references discovered while dumping - * @param array $children The children to dump - * @param int $hashCut The number of items removed from the original hash - * @param string $hashType A Cursor::HASH_* const - * @param bool $dumpKeys Whether keys should be dumped or not - * * @return int The final number of removed items */ - private function dumpChildren($dumper, $parentCursor, &$refs, $children, $hashCut, $hashType, $dumpKeys) + private function dumpChildren(DumperInterface $dumper, Cursor $parentCursor, array &$refs, array $children, int $hashCut, int $hashType, bool $dumpKeys): int { $cursor = clone $parentCursor; ++$cursor->depth; diff --git a/vendor/symfony/var-dumper/Cloner/DumperInterface.php b/vendor/symfony/var-dumper/Cloner/DumperInterface.php index 912bb5213975936ee2cdcd258f4b3886ae54098b..ec8ef2727894d02cc9245a862a3c26db6ba5f29e 100644 --- a/vendor/symfony/var-dumper/Cloner/DumperInterface.php +++ b/vendor/symfony/var-dumper/Cloner/DumperInterface.php @@ -21,26 +21,23 @@ interface DumperInterface /** * Dumps a scalar value. * - * @param Cursor $cursor The Cursor position in the dump - * @param string $type The PHP type of the value being dumped - * @param string|int|float|bool $value The scalar value being dumped + * @param string $type The PHP type of the value being dumped + * @param string|int|float|bool $value The scalar value being dumped */ public function dumpScalar(Cursor $cursor, $type, $value); /** * Dumps a string. * - * @param Cursor $cursor The Cursor position in the dump - * @param string $str The string being dumped - * @param bool $bin Whether $str is UTF-8 or binary encoded - * @param int $cut The number of characters $str has been cut by + * @param string $str The string being dumped + * @param bool $bin Whether $str is UTF-8 or binary encoded + * @param int $cut The number of characters $str has been cut by */ public function dumpString(Cursor $cursor, $str, $bin, $cut); /** * Dumps while entering an hash. * - * @param Cursor $cursor The Cursor position in the dump * @param int $type A Cursor::HASH_* const for the type of hash * @param string|int $class The object class, resource type or array count * @param bool $hasChild When the dump of the hash has child item @@ -50,7 +47,6 @@ public function enterHash(Cursor $cursor, $type, $class, $hasChild); /** * Dumps while leaving an hash. * - * @param Cursor $cursor The Cursor position in the dump * @param int $type A Cursor::HASH_* const for the type of hash * @param string|int $class The object class, resource type or array count * @param bool $hasChild When the dump of the hash has child item diff --git a/vendor/symfony/var-dumper/Cloner/Stub.php b/vendor/symfony/var-dumper/Cloner/Stub.php index a56120ce363112a44d8d1d48154407d2f083a5a3..073c56efbd4c38610ab4e319939aab5e2fcc1688 100644 --- a/vendor/symfony/var-dumper/Cloner/Stub.php +++ b/vendor/symfony/var-dumper/Cloner/Stub.php @@ -18,17 +18,17 @@ */ class Stub { - const TYPE_REF = 1; - const TYPE_STRING = 2; - const TYPE_ARRAY = 3; - const TYPE_OBJECT = 4; - const TYPE_RESOURCE = 5; + public const TYPE_REF = 1; + public const TYPE_STRING = 2; + public const TYPE_ARRAY = 3; + public const TYPE_OBJECT = 4; + public const TYPE_RESOURCE = 5; - const STRING_BINARY = 1; - const STRING_UTF8 = 2; + public const STRING_BINARY = 1; + public const STRING_UTF8 = 2; - const ARRAY_ASSOC = 1; - const ARRAY_INDEXED = 2; + public const ARRAY_ASSOC = 1; + public const ARRAY_INDEXED = 2; public $type = self::TYPE_REF; public $class = ''; @@ -44,7 +44,7 @@ class Stub /** * @internal */ - public function __sleep() + public function __sleep(): array { $properties = []; diff --git a/vendor/symfony/var-dumper/Cloner/VarCloner.php b/vendor/symfony/var-dumper/Cloner/VarCloner.php index 8c4221220ebde2bdd0297d54bb7bd6c217a4e5dc..6a9002137b7c969228dbfd430161e67ca461f2ac 100644 --- a/vendor/symfony/var-dumper/Cloner/VarCloner.php +++ b/vendor/symfony/var-dumper/Cloner/VarCloner.php @@ -17,8 +17,6 @@ class VarCloner extends AbstractCloner { private static $gid; - private static $hashMask = 0; - private static $hashOffset = 0; private static $arrayCache = []; /** @@ -31,11 +29,11 @@ protected function doClone($var) $refsCounter = 0; // Hard references counter $queue = [[$var]]; // This breadth-first queue is the return value $indexedArrays = []; // Map of queue indexes that hold numerically indexed arrays - $hardRefs = []; // Map of original zval hashes to stub objects + $hardRefs = []; // Map of original zval ids to stub objects $objRefs = []; // Map of original object handles to their stub object counterpart $objects = []; // Keep a ref to objects to ensure their handle cannot be reused while cloning $resRefs = []; // Map of original resource handles to their stub object counterpart - $values = []; // Map of stub objects' hashes to original values + $values = []; // Map of stub objects' ids to original values $maxItems = $this->maxItems; $maxString = $this->maxString; $minDepth = $this->minDepth; @@ -47,13 +45,9 @@ protected function doClone($var) $stub = null; // Stub capturing the main properties of an original item value // or null if the original value is used directly - if (!self::$hashMask) { - self::initHashMask(); - self::$gid = md5(dechex(self::$hashMask)); // Unique string used to detect the special $GLOBALS variable + if (!$gid = self::$gid) { + $gid = self::$gid = md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable } - $gid = self::$gid; - $hashMask = self::$hashMask; - $hashOffset = self::$hashOffset; $arrayStub = new Stub(); $arrayStub->type = Stub::TYPE_ARRAY; $fromObjCast = false; @@ -97,7 +91,7 @@ protected function doClone($var) if ($zvalIsRef) { $vals[$k] = &$stub; // Break hard references to make $queue completely unset($stub); // independent from the original structure - if ($v instanceof Stub && isset($hardRefs[spl_object_hash($v)])) { + if ($v instanceof Stub && isset($hardRefs[spl_object_id($v)])) { $vals[$k] = $refs[$k] = $v; if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) { ++$v->value->refCount; @@ -107,7 +101,7 @@ protected function doClone($var) } $refs[$k] = $vals[$k] = new Stub(); $refs[$k]->value = $v; - $h = spl_object_hash($refs[$k]); + $h = spl_object_id($refs[$k]); $hardRefs[$h] = &$refs[$k]; $values[$h] = $v; $vals[$k]->handle = ++$refsCounter; @@ -165,13 +159,19 @@ protected function doClone($var) if (Stub::ARRAY_ASSOC === $stub->class) { // Copies of $GLOBALS have very strange behavior, // let's detect them with some black magic - $a[$gid] = true; - - // Happens with copies of $GLOBALS - if (isset($v[$gid])) { + if (\PHP_VERSION_ID < 80100 && ($a[$gid] = true) && isset($v[$gid])) { unset($v[$gid]); $a = []; foreach ($v as $gk => &$gv) { + if ($v === $gv) { + unset($v); + $v = new Stub(); + $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0]; + $v->handle = -1; + $gv = &$hardRefs[spl_object_id($v)]; + $gv = $v; + } + $a[$gk] = &$gv; } unset($gv); @@ -185,7 +185,7 @@ protected function doClone($var) case \is_object($v): case $v instanceof \__PHP_Incomplete_Class: - if (empty($objRefs[$h = $hashMask ^ hexdec(substr(spl_object_hash($v), $hashOffset, \PHP_INT_SIZE))])) { + if (empty($objRefs[$h = spl_object_id($v)])) { $stub = new Stub(); $stub->type = Stub::TYPE_OBJECT; $stub->class = \get_class($v); @@ -196,8 +196,7 @@ protected function doClone($var) if (Stub::TYPE_OBJECT !== $stub->type || null === $stub->value) { break; } - $h = $hashMask ^ hexdec(substr(spl_object_hash($stub->value), $hashOffset, \PHP_INT_SIZE)); - $stub->handle = $h; + $stub->handle = $h = spl_object_id($stub->value); } $stub->value = null; if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) { @@ -305,31 +304,4 @@ protected function doClone($var) return $queue; } - - private static function initHashMask() - { - $obj = (object) []; - self::$hashOffset = 16 - \PHP_INT_SIZE; - self::$hashMask = -1; - - if (\defined('HHVM_VERSION')) { - self::$hashOffset += 16; - } else { - // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below - $obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush']; - foreach (debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) { - if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) { - $frame['line'] = 0; - break; - } - } - if (!empty($frame['line'])) { - ob_start(); - debug_zval_dump($obj); - self::$hashMask = (int) substr(ob_get_clean(), 17); - } - } - - self::$hashMask ^= hexdec(substr(spl_object_hash($obj), self::$hashOffset, \PHP_INT_SIZE)); - } } diff --git a/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php b/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php new file mode 100644 index 0000000000000000000000000000000000000000..dc77d03ecd80caa09e981a2ef34d1b89b4092977 --- /dev/null +++ b/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php @@ -0,0 +1,88 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Command\Descriptor; + +use Symfony\Component\Console\Formatter\OutputFormatterStyle; +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Dumper\CliDumper; + +/** + * Describe collected data clones for cli output. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + * + * @final + */ +class CliDescriptor implements DumpDescriptorInterface +{ + private $dumper; + private $lastIdentifier; + private $supportsHref; + + public function __construct(CliDumper $dumper) + { + $this->dumper = $dumper; + $this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref'); + } + + public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void + { + $io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output); + $this->dumper->setColors($output->isDecorated()); + + $rows = [['date', date('r', $context['timestamp'])]]; + $lastIdentifier = $this->lastIdentifier; + $this->lastIdentifier = $clientId; + + $section = "Received from client #$clientId"; + if (isset($context['request'])) { + $request = $context['request']; + $this->lastIdentifier = $request['identifier']; + $section = sprintf('%s %s', $request['method'], $request['uri']); + if ($controller = $request['controller']) { + $rows[] = ['controller', rtrim($this->dumper->dump($controller, true), "\n")]; + } + } elseif (isset($context['cli'])) { + $this->lastIdentifier = $context['cli']['identifier']; + $section = '$ '.$context['cli']['command_line']; + } + + if ($this->lastIdentifier !== $lastIdentifier) { + $io->section($section); + } + + if (isset($context['source'])) { + $source = $context['source']; + $sourceInfo = sprintf('%s on line %d', $source['name'], $source['line']); + $fileLink = $source['file_link'] ?? null; + if ($this->supportsHref && $fileLink) { + $sourceInfo = sprintf('<href=%s>%s</>', $fileLink, $sourceInfo); + } + $rows[] = ['source', $sourceInfo]; + $file = $source['file_relative'] ?? $source['file']; + $rows[] = ['file', $file]; + } + + $io->table([], $rows); + + if (!$this->supportsHref && isset($fileLink)) { + $io->writeln(['<info>Open source in your IDE/browser:</info>', $fileLink]); + $io->newLine(); + } + + $this->dumper->dump($data); + $io->newLine(); + } +} diff --git a/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php b/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..267d27bfaccf8de6ee717aa4edd596e93ae3677c --- /dev/null +++ b/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Command\Descriptor; + +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\VarDumper\Cloner\Data; + +/** + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + */ +interface DumpDescriptorInterface +{ + public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void; +} diff --git a/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php b/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php new file mode 100644 index 0000000000000000000000000000000000000000..35a203b0000a59de122ec835c9dba845013fc3f0 --- /dev/null +++ b/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php @@ -0,0 +1,119 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Command\Descriptor; + +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Dumper\HtmlDumper; + +/** + * Describe collected data clones for html output. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + * + * @final + */ +class HtmlDescriptor implements DumpDescriptorInterface +{ + private $dumper; + private $initialized = false; + + public function __construct(HtmlDumper $dumper) + { + $this->dumper = $dumper; + } + + public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void + { + if (!$this->initialized) { + $styles = file_get_contents(__DIR__.'/../../Resources/css/htmlDescriptor.css'); + $scripts = file_get_contents(__DIR__.'/../../Resources/js/htmlDescriptor.js'); + $output->writeln("<style>$styles</style><script>$scripts</script>"); + $this->initialized = true; + } + + $title = '-'; + if (isset($context['request'])) { + $request = $context['request']; + $controller = "<span class='dumped-tag'>{$this->dumper->dump($request['controller'], true, ['maxDepth' => 0])}</span>"; + $title = sprintf('<code>%s</code> <a href="%s">%s</a>', $request['method'], $uri = $request['uri'], $uri); + $dedupIdentifier = $request['identifier']; + } elseif (isset($context['cli'])) { + $title = '<code>$ </code>'.$context['cli']['command_line']; + $dedupIdentifier = $context['cli']['identifier']; + } else { + $dedupIdentifier = uniqid('', true); + } + + $sourceDescription = ''; + if (isset($context['source'])) { + $source = $context['source']; + $projectDir = $source['project_dir'] ?? null; + $sourceDescription = sprintf('%s on line %d', $source['name'], $source['line']); + if (isset($source['file_link'])) { + $sourceDescription = sprintf('<a href="%s">%s</a>', $source['file_link'], $sourceDescription); + } + } + + $isoDate = $this->extractDate($context, 'c'); + $tags = array_filter([ + 'controller' => $controller ?? null, + 'project dir' => $projectDir ?? null, + ]); + + $output->writeln(<<<HTML +<article data-dedup-id="$dedupIdentifier"> + <header> + <div class="row"> + <h2 class="col">$title</h2> + <time class="col text-small" title="$isoDate" datetime="$isoDate"> + {$this->extractDate($context)} + </time> + </div> + {$this->renderTags($tags)} + </header> + <section class="body"> + <p class="text-small"> + $sourceDescription + </p> + {$this->dumper->dump($data, true)} + </section> +</article> +HTML + ); + } + + private function extractDate(array $context, string $format = 'r'): string + { + return date($format, $context['timestamp']); + } + + private function renderTags(array $tags): string + { + if (!$tags) { + return ''; + } + + $renderedTags = ''; + foreach ($tags as $key => $value) { + $renderedTags .= sprintf('<li><span class="badge">%s</span>%s</li>', $key, $value); + } + + return <<<HTML +<div class="row"> + <ul class="tags"> + $renderedTags + </ul> +</div> +HTML; + } +} diff --git a/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/vendor/symfony/var-dumper/Command/ServerDumpCommand.php new file mode 100644 index 0000000000000000000000000000000000000000..3ec8353aff6fa2a1c5c9ad96f6ee8c255bb67549 --- /dev/null +++ b/vendor/symfony/var-dumper/Command/ServerDumpCommand.php @@ -0,0 +1,99 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Command; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor; +use Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface; +use Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor; +use Symfony\Component\VarDumper\Dumper\CliDumper; +use Symfony\Component\VarDumper\Dumper\HtmlDumper; +use Symfony\Component\VarDumper\Server\DumpServer; + +/** + * Starts a dump server to collect and output dumps on a single place with multiple formats support. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + * + * @final + */ +class ServerDumpCommand extends Command +{ + protected static $defaultName = 'server:dump'; + + private $server; + + /** @var DumpDescriptorInterface[] */ + private $descriptors; + + public function __construct(DumpServer $server, array $descriptors = []) + { + $this->server = $server; + $this->descriptors = $descriptors + [ + 'cli' => new CliDescriptor(new CliDumper()), + 'html' => new HtmlDescriptor(new HtmlDumper()), + ]; + + parent::__construct(); + } + + protected function configure() + { + $availableFormats = implode(', ', array_keys($this->descriptors)); + + $this + ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli') + ->setDescription('Start a dump server that collects and displays dumps in a single place') + ->setHelp(<<<'EOF' +<info>%command.name%</info> starts a dump server that collects and displays +dumps in a single place for debugging you application: + + <info>php %command.full_name%</info> + +You can consult dumped data in HTML format in your browser by providing the <comment>--format=html</comment> option +and redirecting the output to a file: + + <info>php %command.full_name% --format="html" > dump.html</info> + +EOF + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output); + $format = $input->getOption('format'); + + if (!$descriptor = $this->descriptors[$format] ?? null) { + throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $format)); + } + + $errorIo = $io->getErrorStyle(); + $errorIo->title('Symfony Var Dumper Server'); + + $this->server->start(); + + $errorIo->success(sprintf('Server listening on %s', $this->server->getHost())); + $errorIo->comment('Quit the server with CONTROL-C.'); + + $this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) { + $descriptor->describe($io, $data, $context, $clientId); + }); + } +} diff --git a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php index 5ea6294f3d1b9b252fdc6704fb6ccb75080d81d5..eea56b599dbcac34cc8adccc5f6fe4981b610754 100644 --- a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php @@ -21,10 +21,10 @@ */ abstract class AbstractDumper implements DataDumperInterface, DumperInterface { - const DUMP_LIGHT_ARRAY = 1; - const DUMP_STRING_LENGTH = 2; - const DUMP_COMMA_SEPARATOR = 4; - const DUMP_TRAILING_COMMA = 8; + public const DUMP_LIGHT_ARRAY = 1; + public const DUMP_STRING_LENGTH = 2; + public const DUMP_COMMA_SEPARATOR = 4; + public const DUMP_TRAILING_COMMA = 8; public static $defaultOutput = 'php://output'; @@ -42,9 +42,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface * @param string|null $charset The default character encoding to use for non-UTF8 strings * @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation */ - public function __construct($output = null, $charset = null, $flags = 0) + public function __construct($output = null, string $charset = null, int $flags = 0) { - $this->flags = (int) $flags; + $this->flags = $flags; $this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8'); $this->decimalPoint = localeconv(); $this->decimalPoint = $this->decimalPoint['decimal_point']; @@ -70,7 +70,7 @@ public function setOutput($output) $this->lineDumper = $output; } else { if (\is_string($output)) { - $output = fopen($output, 'wb'); + $output = fopen($output, 'w'); } $this->outputStream = $output; $this->lineDumper = [$this, 'echoLine']; @@ -116,7 +116,6 @@ public function setIndentPad($pad) /** * Dumps a Data object. * - * @param Data $data A Data object * @param callable|resource|string|true|null $output A line dumper callable, an opened stream, an output path or true to return the dump * * @return string|null The dump as string when $output is true @@ -131,7 +130,7 @@ public function dump(Data $data, $output = null) } if ($returnDump = true === $output) { - $output = fopen('php://memory', 'r+b'); + $output = fopen('php://memory', 'r+'); } if ($output) { $prevOutput = $this->setOutput($output); @@ -166,7 +165,7 @@ public function dump(Data $data, $output = null) */ protected function dumpLine($depth) { - \call_user_func($this->lineDumper, $this->line, $depth, $this->indentPad); + ($this->lineDumper)($this->line, $depth, $this->indentPad); $this->line = ''; } diff --git a/vendor/symfony/var-dumper/Dumper/CliDumper.php b/vendor/symfony/var-dumper/Dumper/CliDumper.php index 4c48ab7cc82abdf0e8eb965e7fd220314f6fe9c9..55484b0b0a878c7d0f836d5837d9f02d7a47d1c2 100644 --- a/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -55,10 +55,16 @@ class CliDumper extends AbstractDumper protected $collapseNextHash = false; protected $expandNextHash = false; + private $displayOptions = [ + 'fileLinkFormat' => null, + ]; + + private $handlesHrefGracefully; + /** * {@inheritdoc} */ - public function __construct($output = null, $charset = null, $flags = 0) + public function __construct($output = null, string $charset = null, int $flags = 0) { parent::__construct($output, $charset, $flags); @@ -76,6 +82,8 @@ public function __construct($output = null, $charset = null, $flags = 0) 'index' => '34', ]); } + + $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l'; } /** @@ -108,6 +116,16 @@ public function setStyles(array $styles) $this->styles = $styles + $this->styles; } + /** + * Configures display options. + * + * @param array $displayOptions A map of display options to customize the behavior + */ + public function setDisplayOptions(array $displayOptions) + { + $this->displayOptions = $displayOptions + $this->displayOptions; + } + /** * {@inheritdoc} */ @@ -260,6 +278,7 @@ public function enterHash(Cursor $cursor, $type, $class, $hasChild) } $this->dumpKey($cursor); + $attr = $cursor->attr; if ($this->collapseNextHash) { $cursor->skipChildren = true; @@ -268,14 +287,14 @@ public function enterHash(Cursor $cursor, $type, $class, $hasChild) $class = $this->utf8Encode($class); if (Cursor::HASH_OBJECT === $type) { - $prefix = $class && 'stdClass' !== $class ? $this->style('note', $class).' {' : '{'; + $prefix = $class && 'stdClass' !== $class ? $this->style('note', $class, $attr).(empty($attr['cut_hash']) ? ' {' : '') : '{'; } elseif (Cursor::HASH_RESOURCE === $type) { - $prefix = $this->style('note', $class.' resource').($hasChild ? ' {' : ' '); + $prefix = $this->style('note', $class.' resource', $attr).($hasChild ? ' {' : ' '); } else { $prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:'.$class).' [' : '['; } - if ($cursor->softRefCount || 0 < $cursor->softRefHandle) { + if (($cursor->softRefCount || 0 < $cursor->softRefHandle) && empty($attr['cut_hash'])) { $prefix .= $this->style('ref', (Cursor::HASH_RESOURCE === $type ? '@' : '#').(0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->softRefTo), ['count' => $cursor->softRefCount]); } elseif ($cursor->hardRefTo && !$cursor->refIndex && $class) { $prefix .= $this->style('ref', '&'.$cursor->hardRefTo, ['count' => $cursor->hardRefCount]); @@ -295,17 +314,19 @@ public function enterHash(Cursor $cursor, $type, $class, $hasChild) */ public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut) { - $this->dumpEllipsis($cursor, $hasChild, $cut); - $this->line .= Cursor::HASH_OBJECT === $type ? '}' : (Cursor::HASH_RESOURCE !== $type ? ']' : ($hasChild ? '}' : '')); + if (empty($cursor->attr['cut_hash'])) { + $this->dumpEllipsis($cursor, $hasChild, $cut); + $this->line .= Cursor::HASH_OBJECT === $type ? '}' : (Cursor::HASH_RESOURCE !== $type ? ']' : ($hasChild ? '}' : '')); + } + $this->endValue($cursor); } /** * Dumps an ellipsis for cut children. * - * @param Cursor $cursor The Cursor position in the dump - * @param bool $hasChild When the dump of the hash has child item - * @param int $cut The number of items the hash has been cut by + * @param bool $hasChild When the dump of the hash has child item + * @param int $cut The number of items the hash has been cut by */ protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut) { @@ -322,8 +343,6 @@ protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut) /** * Dumps a key in a hash structure. - * - * @param Cursor $cursor The Cursor position in the dump */ protected function dumpKey(Cursor $cursor) { @@ -390,7 +409,7 @@ protected function dumpKey(Cursor $cursor) } } - $this->line .= $bin.$this->style($style, $key[1], $attr).(isset($attr['separator']) ? $attr['separator'] : ': '); + $this->line .= $bin.$this->style($style, $key[1], $attr).($attr['separator'] ?? ': '); } else { // This case should not happen $this->line .= '-'.$bin.'"'.$this->style('private', $key, ['class' => '']).'": '; @@ -419,6 +438,11 @@ protected function style($style, $value, $attr = []) $this->colors = $this->supportsColors(); } + if (null === $this->handlesHrefGracefully) { + $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + } + if (isset($attr['ellipsis'], $attr['ellipsis-type'])) { $prefix = substr($value, 0, -$attr['ellipsis']); if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && 0 === strpos($prefix, $_SERVER[$pwd])) { @@ -431,19 +455,19 @@ protected function style($style, $value, $attr = []) $value = substr($value, -$attr['ellipsis']); } - return $this->style('default', $prefix).$this->style($style, $value); - } + $value = $this->style('default', $prefix).$this->style($style, $value); - $style = $this->styles[$style]; + goto href; + } $map = static::$controlCharsMap; $startCchr = $this->colors ? "\033[m\033[{$this->styles['default']}m" : ''; - $endCchr = $this->colors ? "\033[m\033[{$style}m" : ''; + $endCchr = $this->colors ? "\033[m\033[{$this->styles[$style]}m" : ''; $value = preg_replace_callback(static::$controlCharsRx, function ($c) use ($map, $startCchr, $endCchr) { $s = $startCchr; $c = $c[$i = 0]; do { - $s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', \ord($c[$i])); + $s .= $map[$c[$i]] ?? sprintf('\x%02X', \ord($c[$i])); } while (isset($c[++$i])); return $s.$endCchr; @@ -453,7 +477,7 @@ protected function style($style, $value, $attr = []) if ($cchrCount && "\033" === $value[0]) { $value = substr($value, \strlen($startCchr)); } else { - $value = "\033[{$style}m".$value; + $value = "\033[{$this->styles[$style]}m".$value; } if ($cchrCount && $endCchr === substr($value, -\strlen($endCchr))) { $value = substr($value, 0, -\strlen($endCchr)); @@ -462,6 +486,22 @@ protected function style($style, $value, $attr = []) } } + href: + if ($this->colors && $this->handlesHrefGracefully) { + if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) { + if ('note' === $style) { + $value .= "\033]8;;{$href}\033\\^\033]8;;\033\\"; + } else { + $attr['href'] = $href; + } + } + if (isset($attr['href'])) { + $value = "\033]8;;{$attr['href']}\033\\{$value}\033]8;;\033\\"; + } + } elseif ($attr['if_links'] ?? false) { + return ''; + } + return $value; } @@ -500,7 +540,7 @@ protected function supportsColors() } $h = stream_get_meta_data($this->outputStream) + ['wrapper_type' => null]; - $h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'wb') : $this->outputStream; + $h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'w') : $this->outputStream; return static::$defaultColors = $this->hasColorSupport($h); } @@ -518,6 +558,10 @@ protected function dumpLine($depth, $endOfValue = false) protected function endValue(Cursor $cursor) { + if (-1 === $cursor->hashType) { + return; + } + if (Stub::ARRAY_INDEXED === $cursor->hashType || Stub::ARRAY_ASSOC === $cursor->hashType) { if (self::DUMP_TRAILING_COMMA & $this->flags && 0 < $cursor->depth) { $this->line .= ','; @@ -536,15 +580,18 @@ protected function endValue(Cursor $cursor) * https://github.com/composer/xdebug-handler * * @param mixed $stream A CLI output stream - * - * @return bool */ - private function hasColorSupport($stream) + private function hasColorSupport($stream): bool { if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { return false; } + // Follow https://no-color.org/ + if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + return false; + } + if ('Hyper' === getenv('TERM_PROGRAM')) { return true; } @@ -576,10 +623,8 @@ private function hasColorSupport($stream) * Note that this does not check an output stream, but relies on environment * variables from known implementations, or a PHP and Windows version that * supports true color. - * - * @return bool */ - private function isWindowsTrueColor() + private function isWindowsTrueColor(): bool { $result = 183 <= getenv('ANSICON_VER') || 'ON' === getenv('ConEmuANSI') @@ -598,4 +643,13 @@ private function isWindowsTrueColor() return $result; } + + private function getSourceLink(string $file, int $line) + { + if ($fmt = $this->displayOptions['fileLinkFormat']) { + return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : ($fmt->format($file, $line) ?: 'file://'.$file.'#L'.$line); + } + + return false; + } } diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php new file mode 100644 index 0000000000000000000000000000000000000000..38f878971c53faa168086d7284861cfc2d1785a6 --- /dev/null +++ b/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php @@ -0,0 +1,32 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Dumper\ContextProvider; + +/** + * Tries to provide context on CLI. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + */ +final class CliContextProvider implements ContextProviderInterface +{ + public function getContext(): ?array + { + if ('cli' !== \PHP_SAPI) { + return null; + } + + return [ + 'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []), + 'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']), + ]; + } +} diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..38ef3b0f18530d938154e5e5cc56cd05b192edd5 --- /dev/null +++ b/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php @@ -0,0 +1,25 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Dumper\ContextProvider; + +/** + * Interface to provide contextual data about dump data clones sent to a server. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + */ +interface ContextProviderInterface +{ + /** + * @return array|null Context data or null if unable to provide any context + */ + public function getContext(): ?array; +} diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php new file mode 100644 index 0000000000000000000000000000000000000000..3684a47535cfc982e95eb866e6ee20a6818c12b9 --- /dev/null +++ b/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php @@ -0,0 +1,51 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Dumper\ContextProvider; + +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\VarDumper\Caster\ReflectionCaster; +use Symfony\Component\VarDumper\Cloner\VarCloner; + +/** + * Tries to provide context from a request. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + */ +final class RequestContextProvider implements ContextProviderInterface +{ + private $requestStack; + private $cloner; + + public function __construct(RequestStack $requestStack) + { + $this->requestStack = $requestStack; + $this->cloner = new VarCloner(); + $this->cloner->setMaxItems(0); + $this->cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); + } + + public function getContext(): ?array + { + if (null === $request = $this->requestStack->getCurrentRequest()) { + return null; + } + + $controller = $request->attributes->get('_controller'); + + return [ + 'uri' => $request->getUri(), + 'method' => $request->getMethod(), + 'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller, + 'identifier' => spl_object_hash($request), + ]; + } +} diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php new file mode 100644 index 0000000000000000000000000000000000000000..c3cd3221a8007c54e3df97b15a96c251411f9b23 --- /dev/null +++ b/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php @@ -0,0 +1,126 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Dumper\ContextProvider; + +use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; +use Symfony\Component\VarDumper\Cloner\VarCloner; +use Symfony\Component\VarDumper\Dumper\HtmlDumper; +use Symfony\Component\VarDumper\VarDumper; +use Twig\Template; + +/** + * Tries to provide context from sources (class name, file, line, code excerpt, ...). + * + * @author Nicolas Grekas <p@tchwork.com> + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + */ +final class SourceContextProvider implements ContextProviderInterface +{ + private $limit; + private $charset; + private $projectDir; + private $fileLinkFormatter; + + public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9) + { + $this->charset = $charset; + $this->projectDir = $projectDir; + $this->fileLinkFormatter = $fileLinkFormatter; + $this->limit = $limit; + } + + public function getContext(): ?array + { + $trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, $this->limit); + + $file = $trace[1]['file']; + $line = $trace[1]['line']; + $name = false; + $fileExcerpt = false; + + for ($i = 2; $i < $this->limit; ++$i) { + if (isset($trace[$i]['class'], $trace[$i]['function']) + && 'dump' === $trace[$i]['function'] + && VarDumper::class === $trace[$i]['class'] + ) { + $file = $trace[$i]['file'] ?? $file; + $line = $trace[$i]['line'] ?? $line; + + while (++$i < $this->limit) { + if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && 0 !== strpos($trace[$i]['function'], 'call_user_func')) { + $file = $trace[$i]['file']; + $line = $trace[$i]['line']; + + break; + } elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof Template) { + $template = $trace[$i]['object']; + $name = $template->getTemplateName(); + $src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false); + $info = $template->getDebugInfo(); + if (isset($info[$trace[$i - 1]['line']])) { + $line = $info[$trace[$i - 1]['line']]; + $file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null; + + if ($src) { + $src = explode("\n", $src); + $fileExcerpt = []; + + for ($i = max($line - 3, 1), $max = min($line + 3, \count($src)); $i <= $max; ++$i) { + $fileExcerpt[] = '<li'.($i === $line ? ' class="selected"' : '').'><code>'.$this->htmlEncode($src[$i - 1]).'</code></li>'; + } + + $fileExcerpt = '<ol start="'.max($line - 3, 1).'">'.implode("\n", $fileExcerpt).'</ol>'; + } + } + break; + } + } + break; + } + } + + if (false === $name) { + $name = str_replace('\\', '/', $file); + $name = substr($name, strrpos($name, '/') + 1); + } + + $context = ['name' => $name, 'file' => $file, 'line' => $line]; + $context['file_excerpt'] = $fileExcerpt; + + if (null !== $this->projectDir) { + $context['project_dir'] = $this->projectDir; + if (0 === strpos($file, $this->projectDir)) { + $context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR); + } + } + + if ($this->fileLinkFormatter && $fileLink = $this->fileLinkFormatter->format($context['file'], $context['line'])) { + $context['file_link'] = $fileLink; + } + + return $context; + } + + private function htmlEncode(string $s): string + { + $html = ''; + + $dumper = new HtmlDumper(function ($line) use (&$html) { $html .= $line; }, $this->charset); + $dumper->setDumpHeader(''); + $dumper->setDumpBoundaries('', ''); + + $cloner = new VarCloner(); + $dumper->dump($cloner->cloneVar($s)); + + return substr(strip_tags($html), 1, -1); + } +} diff --git a/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php b/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php new file mode 100644 index 0000000000000000000000000000000000000000..76384176ef026ae81c0c6c1378724ea456763716 --- /dev/null +++ b/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php @@ -0,0 +1,43 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Dumper; + +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; + +/** + * @author Kévin Thérage <therage.kevin@gmail.com> + */ +class ContextualizedDumper implements DataDumperInterface +{ + private $wrappedDumper; + private $contextProviders; + + /** + * @param ContextProviderInterface[] $contextProviders + */ + public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders) + { + $this->wrappedDumper = $wrappedDumper; + $this->contextProviders = $contextProviders; + } + + public function dump(Data $data) + { + $context = []; + foreach ($this->contextProviders as $contextProvider) { + $context[\get_class($contextProvider)] = $contextProvider->getContext(); + } + + $this->wrappedDumper->dump($data->withContext($context)); + } +} diff --git a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index ccbdc96f233abae6480943e92a82f6590928ddee..6b205a73738d26948d947834ce4cda662d14222e 100644 --- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -23,6 +23,41 @@ class HtmlDumper extends CliDumper { public static $defaultOutput = 'php://output'; + protected static $themes = [ + 'dark' => [ + 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all', + 'num' => 'font-weight:bold; color:#1299DA', + 'const' => 'font-weight:bold', + 'str' => 'font-weight:bold; color:#56DB3A', + 'note' => 'color:#1299DA', + 'ref' => 'color:#A0A0A0', + 'public' => 'color:#FFFFFF', + 'protected' => 'color:#FFFFFF', + 'private' => 'color:#FFFFFF', + 'meta' => 'color:#B729D9', + 'key' => 'color:#56DB3A', + 'index' => 'color:#1299DA', + 'ellipsis' => 'color:#FF8400', + 'ns' => 'user-select:none;', + ], + 'light' => [ + 'default' => 'background:none; color:#CC7832; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all', + 'num' => 'font-weight:bold; color:#1299DA', + 'const' => 'font-weight:bold', + 'str' => 'font-weight:bold; color:#629755;', + 'note' => 'color:#6897BB', + 'ref' => 'color:#6E6E6E', + 'public' => 'color:#262626', + 'protected' => 'color:#262626', + 'private' => 'color:#262626', + 'meta' => 'color:#B729D9', + 'key' => 'color:#789339', + 'index' => 'color:#1299DA', + 'ellipsis' => 'color:#CC7832', + 'ns' => 'user-select:none;', + ], + ]; + protected $dumpHeader; protected $dumpPrefix = '<pre class=sf-dump id=%s data-indent-pad="%s">'; protected $dumpSuffix = '</pre><script>Sfdump(%s)</script>'; @@ -30,21 +65,7 @@ class HtmlDumper extends CliDumper protected $colors = true; protected $headerIsDumped = false; protected $lastDepth = -1; - protected $styles = [ - 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all', - 'num' => 'font-weight:bold; color:#1299DA', - 'const' => 'font-weight:bold', - 'str' => 'font-weight:bold; color:#56DB3A', - 'note' => 'color:#1299DA', - 'ref' => 'color:#A0A0A0', - 'public' => 'color:#FFFFFF', - 'protected' => 'color:#FFFFFF', - 'private' => 'color:#FFFFFF', - 'meta' => 'color:#B729D9', - 'key' => 'color:#56DB3A', - 'index' => 'color:#1299DA', - 'ellipsis' => 'color:#FF8400', - ]; + protected $styles; private $displayOptions = [ 'maxDepth' => 1, @@ -56,11 +77,12 @@ class HtmlDumper extends CliDumper /** * {@inheritdoc} */ - public function __construct($output = null, $charset = null, $flags = 0) + public function __construct($output = null, string $charset = null, int $flags = 0) { AbstractDumper::__construct($output, $charset, $flags); $this->dumpId = 'sf-dump-'.mt_rand(); $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); + $this->styles = static::$themes['dark'] ?? self::$themes['dark']; } /** @@ -72,6 +94,15 @@ public function setStyles(array $styles) $this->styles = $styles + $this->styles; } + public function setTheme(string $themeName) + { + if (!isset(static::$themes[$themeName])) { + throw new \InvalidArgumentException(sprintf('Theme "%s" does not exist in class "%s".', $themeName, static::class)); + } + + $this->setStyles(static::$themes[$themeName]); + } + /** * Configures display options. * @@ -283,13 +314,21 @@ function resetHighlightedNodes(root) { } function a(e, f) { - addEventListener(root, e, function (e) { + addEventListener(root, e, function (e, n) { if ('A' == e.target.tagName) { f(e.target, e); } else if ('A' == e.target.parentNode.tagName) { f(e.target.parentNode, e); - } else if (e.target.nextElementSibling && 'A' == e.target.nextElementSibling.tagName) { - f(e.target.nextElementSibling, e, true); + } else { + n = /\bsf-dump-ellipsis\b/.test(e.target.className) ? e.target.parentNode : e.target; + + if ((n = n.nextElementSibling) && 'A' == n.tagName) { + if (!/\bsf-dump-toggle\b/.test(n.className)) { + n = n.nextElementSibling || n; + } + + f(n, e, true); + } } }); }; @@ -469,10 +508,18 @@ function xpathHasClass(className) { function showCurrent(state) { - var currentNode = state.current(); + var currentNode = state.current(), currentRect, searchRect; if (currentNode) { reveal(currentNode); highlight(root, currentNode, state.nodes); + if ('scrollIntoView' in currentNode) { + currentNode.scrollIntoView(true); + currentRect = currentNode.getBoundingClientRect(); + searchRect = search.getBoundingClientRect(); + if (currentRect.top < (searchRect.top + searchRect.height)) { + window.scrollBy(0, -(searchRect.top + searchRect.height + 5)); + } + } } counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' of ' + state.count(); } @@ -545,6 +592,15 @@ function showCurrent(state) var isSearchActive = !/\bsf-dump-search-hidden\b/.test(search.className); if ((114 === e.keyCode && !isSearchActive) || (isCtrlKey(e) && 70 === e.keyCode)) { /* F3 or CMD/CTRL + F */ + if (70 === e.keyCode && document.activeElement === searchInput) { + /* + * If CMD/CTRL + F is hit while having focus on search input, + * the user probably meant to trigger browser search instead. + * Let the browser execute its behavior: + */ + return; + } + e.preventDefault(); search.className = search.className.replace(/\bsf-dump-search-hidden\b/, ''); searchInput.focus(); @@ -603,6 +659,7 @@ function showCurrent(state) display: block; white-space: pre; padding: 5px; + overflow: initial !important; } pre.sf-dump:after { content: ""; @@ -617,11 +674,6 @@ function showCurrent(state) pre.sf-dump .sf-dump-compact { display: none; } -pre.sf-dump abbr { - text-decoration: none; - border: none; - cursor: help; -} pre.sf-dump a { text-decoration: none; cursor: pointer; @@ -629,6 +681,13 @@ function showCurrent(state) outline: none; color: inherit; } +pre.sf-dump img { + max-width: 50em; + max-height: 50em; + margin: .5em 0 0 0; + padding: 0; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAHUlEQVQY02O8zAABilCaiQEN0EeA8QuUcX9g3QEAAjcC5piyhyEAAAAASUVORK5CYII=) #D3D3D3; +} pre.sf-dump .sf-dump-ellipsis { display: inline-block; overflow: visible; @@ -671,14 +730,16 @@ function showCurrent(state) border-radius: 3px; } pre.sf-dump .sf-dump-search-hidden { - display: none; + display: none !important; } pre.sf-dump .sf-dump-search-wrapper { - float: right; font-size: 0; white-space: nowrap; - max-width: 100%; - text-align: right; + margin-bottom: 5px; + display: flex; + position: -webkit-sticky; + position: sticky; + top: 5px; } pre.sf-dump .sf-dump-search-wrapper > * { vertical-align: top; @@ -695,10 +756,11 @@ function showCurrent(state) height: 21px; font-size: 12px; border-right: none; - width: 140px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; color: #000; + min-width: 15px; + width: 100%; } pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next, pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous { @@ -732,15 +794,36 @@ function showCurrent(state) foreach ($this->styles as $class => $style) { $line .= 'pre.sf-dump'.('default' === $class ? ', pre.sf-dump' : '').' .sf-dump-'.$class.'{'.$style.'}'; } + $line .= 'pre.sf-dump .sf-dump-ellipsis-note{'.$this->styles['note'].'}'; return $this->dumpHeader = preg_replace('/\s+/', ' ', $line).'</style>'.$this->dumpHeader; } + /** + * {@inheritdoc} + */ + public function dumpString(Cursor $cursor, $str, $bin, $cut) + { + if ('' === $str && isset($cursor->attr['img-data'], $cursor->attr['content-type'])) { + $this->dumpKey($cursor); + $this->line .= $this->style('default', $cursor->attr['img-size'] ?? '', []).' <samp>'; + $this->endValue($cursor); + $this->line .= $this->indentPad; + $this->line .= sprintf('<img src="data:%s;base64,%s" /></samp>', $cursor->attr['content-type'], base64_encode($cursor->attr['img-data'])); + $this->endValue($cursor); + } else { + parent::dumpString($cursor, $str, $bin, $cut); + } + } + /** * {@inheritdoc} */ public function enterHash(Cursor $cursor, $type, $class, $hasChild) { + if (Cursor::HASH_OBJECT === $type) { + $cursor->attr['depth'] = $cursor->depth; + } parent::enterHash($cursor, $type, $class, false); if ($cursor->skipChildren) { @@ -804,8 +887,13 @@ protected function style($style, $value, $attr = []) $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property'); } elseif ('str' === $style && 1 < $attr['length']) { $style .= sprintf(' title="%d%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : ''); - } elseif ('note' === $style && false !== $c = strrpos($v, '\\')) { - return sprintf('<abbr title="%s" class=sf-dump-%s>%s</abbr>', $v, $style, substr($v, $c + 1)); + } elseif ('note' === $style && 0 < ($attr['depth'] ?? 0) && false !== $c = strrpos($value, '\\')) { + $style .= ' title=""'; + $attr += [ + 'ellipsis' => \strlen($value) - $c, + 'ellipsis-type' => 'note', + 'ellipsis-tail' => 1, + ]; } elseif ('protected' === $style) { $style .= ' title="Protected property"'; } elseif ('meta' === $style && isset($attr['title'])) { @@ -826,23 +914,35 @@ protected function style($style, $value, $attr = []) if (!empty($attr['ellipsis-tail'])) { $tail = \strlen(esc(substr($value, -$attr['ellipsis'], $attr['ellipsis-tail']))); - $v .= sprintf('<span class=sf-dump-ellipsis>%s</span>%s', substr($label, 0, $tail), substr($label, $tail)); + $v .= sprintf('<span class=%s>%s</span>%s', $class, substr($label, 0, $tail), substr($label, $tail)); } else { $v .= $label; } } $v = "<span class=sf-dump-{$style}>".preg_replace_callback(static::$controlCharsRx, function ($c) use ($map) { - $s = '<span class=sf-dump-default>'; + $s = $b = '<span class="sf-dump-default'; $c = $c[$i = 0]; + if ($ns = "\r" === $c[$i] || "\n" === $c[$i]) { + $s .= ' sf-dump-ns'; + } + $s .= '">'; do { - $s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', \ord($c[$i])); + if (("\r" === $c[$i] || "\n" === $c[$i]) !== $ns) { + $s .= '</span>'.$b; + if ($ns = !$ns) { + $s .= ' sf-dump-ns'; + } + $s .= '">'; + } + + $s .= $map[$c[$i]] ?? sprintf('\x%02X', \ord($c[$i])); } while (isset($c[++$i])); return $s.'</span>'; }, $v).'</span>'; - if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], isset($attr['line']) ? $attr['line'] : 0)) { + if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) { $attr['href'] = $href; } if (isset($attr['href'])) { @@ -886,7 +986,7 @@ protected function dumpLine($depth, $endOfValue = false) AbstractDumper::dumpLine($depth); } - private function getSourceLink($file, $line) + private function getSourceLink(string $file, int $line) { $options = $this->extraDisplayOptions + $this->displayOptions; diff --git a/vendor/symfony/var-dumper/Dumper/ServerDumper.php b/vendor/symfony/var-dumper/Dumper/ServerDumper.php new file mode 100644 index 0000000000000000000000000000000000000000..94795bf6d69dda4eb270a895639b3f858fb368eb --- /dev/null +++ b/vendor/symfony/var-dumper/Dumper/ServerDumper.php @@ -0,0 +1,53 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Dumper; + +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; +use Symfony\Component\VarDumper\Server\Connection; + +/** + * ServerDumper forwards serialized Data clones to a server. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + */ +class ServerDumper implements DataDumperInterface +{ + private $connection; + private $wrappedDumper; + + /** + * @param string $host The server host + * @param DataDumperInterface|null $wrappedDumper A wrapped instance used whenever we failed contacting the server + * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name + */ + public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = []) + { + $this->connection = new Connection($host, $contextProviders); + $this->wrappedDumper = $wrappedDumper; + } + + public function getContextProviders(): array + { + return $this->connection->getContextProviders(); + } + + /** + * {@inheritdoc} + */ + public function dump(Data $data) + { + if (!$this->connection->write($data) && $this->wrappedDumper) { + $this->wrappedDumper->dump($data); + } + } +} diff --git a/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php b/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php index af47753ad5b692f27ca287b19b16b3fdfed039c1..122f0d358a12906266644e7b84853ab3dae1fe2a 100644 --- a/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php +++ b/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php @@ -17,9 +17,9 @@ class ThrowingCasterException extends \Exception { /** - * @param \Exception $prev The exception thrown from the caster + * @param \Throwable $prev The exception thrown from the caster */ - public function __construct(\Exception $prev) + public function __construct(\Throwable $prev) { parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev); } diff --git a/vendor/symfony/var-dumper/LICENSE b/vendor/symfony/var-dumper/LICENSE index 684fbf94df83c1ab0d15ccb159147c4c9d483e85..c1f0aac1c56143c5f1d4b8be56f7d2b256f2d384 100644 --- a/vendor/symfony/var-dumper/LICENSE +++ b/vendor/symfony/var-dumper/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2020 Fabien Potencier +Copyright (c) 2014-2021 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/var-dumper/Resources/bin/var-dump-server b/vendor/symfony/var-dumper/Resources/bin/var-dump-server new file mode 100755 index 0000000000000000000000000000000000000000..98c813a0639b5797bfa60d9c780860de655fcdc6 --- /dev/null +++ b/vendor/symfony/var-dumper/Resources/bin/var-dump-server @@ -0,0 +1,63 @@ +#!/usr/bin/env php +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Starts a dump server to collect and output dumps on a single place with multiple formats support. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + */ + +use Psr\Log\LoggerInterface; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Logger\ConsoleLogger; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\VarDumper\Command\ServerDumpCommand; +use Symfony\Component\VarDumper\Server\DumpServer; + +function includeIfExists(string $file): bool +{ + return file_exists($file) && include $file; +} + +if ( + !includeIfExists(__DIR__ . '/../../../../autoload.php') && + !includeIfExists(__DIR__ . '/../../vendor/autoload.php') && + !includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php') +) { + fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL); + exit(1); +} + +if (!class_exists(Application::class)) { + fwrite(STDERR, 'You need the "symfony/console" component in order to run the VarDumper server.'.PHP_EOL); + exit(1); +} + +$input = new ArgvInput(); +$output = new ConsoleOutput(); +$defaultHost = '127.0.0.1:9912'; +$host = $input->getParameterOption(['--host'], $_SERVER['VAR_DUMPER_SERVER'] ?? $defaultHost, true); +$logger = interface_exists(LoggerInterface::class) ? new ConsoleLogger($output->getErrorOutput()) : null; + +$app = new Application(); + +$app->getDefinition()->addOption( + new InputOption('--host', null, InputOption::VALUE_REQUIRED, 'The address the server should listen to', $defaultHost) +); + +$app->add($command = new ServerDumpCommand(new DumpServer($host, $logger))) + ->getApplication() + ->setDefaultCommand($command->getName(), true) + ->run($input, $output) +; diff --git a/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css b/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css new file mode 100644 index 0000000000000000000000000000000000000000..8f706d640f0b707653cdaec6db69f4d812b6e33a --- /dev/null +++ b/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css @@ -0,0 +1,130 @@ +body { + display: flex; + flex-direction: column-reverse; + justify-content: flex-end; + max-width: 1140px; + margin: auto; + padding: 15px; + word-wrap: break-word; + background-color: #F9F9F9; + color: #222; + font-family: Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.4; +} +p { + margin: 0; +} +a { + color: #218BC3; + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +.text-small { + font-size: 12px !important; +} +article { + margin: 5px; + margin-bottom: 10px; +} +article > header > .row { + display: flex; + flex-direction: row; + align-items: baseline; + margin-bottom: 10px; +} +article > header > .row > .col { + flex: 1; + display: flex; + align-items: baseline; +} +article > header > .row > h2 { + font-size: 14px; + color: #222; + font-weight: normal; + font-family: "Lucida Console", monospace, sans-serif; + word-break: break-all; + margin: 20px 5px 0 0; + user-select: all; +} +article > header > .row > h2 > code { + white-space: nowrap; + user-select: none; + color: #cc2255; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; + border-radius: 3px; + margin-right: 5px; + padding: 0 3px; +} +article > header > .row > time.col { + flex: 0; + text-align: right; + white-space: nowrap; + color: #999; + font-style: italic; +} +article > header ul.tags { + list-style: none; + padding: 0; + margin: 0; + font-size: 12px; +} +article > header ul.tags > li { + user-select: all; + margin-bottom: 2px; +} +article > header ul.tags > li > span.badge { + display: inline-block; + padding: .25em .4em; + margin-right: 5px; + border-radius: 4px; + background-color: #6c757d3b; + color: #524d4d; + font-size: 12px; + text-align: center; + font-weight: 700; + line-height: 1; + white-space: nowrap; + vertical-align: baseline; + user-select: none; +} +article > section.body { + border: 1px solid #d8d8d8; + background: #FFF; + padding: 10px; + border-radius: 3px; +} +pre.sf-dump { + border-radius: 3px; + margin-bottom: 0; +} +.hidden { + display: none !important; +} +.dumped-tag > .sf-dump { + display: inline-block; + margin: 0; + padding: 1px 5px; + line-height: 1.4; + vertical-align: top; + background-color: transparent; + user-select: auto; +} +.dumped-tag > pre.sf-dump, +.dumped-tag > .sf-dump-default { + color: #CC7832; + background: none; +} +.dumped-tag > .sf-dump .sf-dump-str { color: #629755; } +.dumped-tag > .sf-dump .sf-dump-private, +.dumped-tag > .sf-dump .sf-dump-protected, +.dumped-tag > .sf-dump .sf-dump-public { color: #262626; } +.dumped-tag > .sf-dump .sf-dump-note { color: #6897BB; } +.dumped-tag > .sf-dump .sf-dump-key { color: #789339; } +.dumped-tag > .sf-dump .sf-dump-ref { color: #6E6E6E; } +.dumped-tag > .sf-dump .sf-dump-ellipsis { color: #CC7832; max-width: 100em; } +.dumped-tag > .sf-dump .sf-dump-ellipsis-path { max-width: 5em; } +.dumped-tag > .sf-dump .sf-dump-ns { user-select: none; } diff --git a/vendor/symfony/var-dumper/Resources/functions/dump.php b/vendor/symfony/var-dumper/Resources/functions/dump.php index 0e0e4d043521816b22871997b72ce5d9f8edb13f..a485d573a007a9016f1d529536206a4b7b6d3607 100644 --- a/vendor/symfony/var-dumper/Resources/functions/dump.php +++ b/vendor/symfony/var-dumper/Resources/functions/dump.php @@ -15,9 +15,11 @@ /** * @author Nicolas Grekas <p@tchwork.com> */ - function dump($var) + function dump($var, ...$moreVars) { - foreach (func_get_args() as $v) { + VarDumper::dump($var); + + foreach ($moreVars as $v) { VarDumper::dump($v); } @@ -28,3 +30,14 @@ function dump($var) return $var; } } + +if (!function_exists('dd')) { + function dd(...$vars) + { + foreach ($vars as $v) { + VarDumper::dump($v); + } + + exit(1); + } +} diff --git a/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js b/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js new file mode 100644 index 0000000000000000000000000000000000000000..63101e57c3c75d04ab70e77e7dbd955677c4e9ca --- /dev/null +++ b/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js @@ -0,0 +1,10 @@ +document.addEventListener('DOMContentLoaded', function() { + let prev = null; + Array.from(document.getElementsByTagName('article')).reverse().forEach(function (article) { + const dedupId = article.dataset.dedupId; + if (dedupId === prev) { + article.getElementsByTagName('header')[0].classList.add('hidden'); + } + prev = dedupId; + }); +}); diff --git a/vendor/symfony/var-dumper/Server/Connection.php b/vendor/symfony/var-dumper/Server/Connection.php new file mode 100644 index 0000000000000000000000000000000000000000..d8be23587e764a4b22b684fa7fe631f4119310cd --- /dev/null +++ b/vendor/symfony/var-dumper/Server/Connection.php @@ -0,0 +1,95 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Server; + +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; + +/** + * Forwards serialized Data clones to a server. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + */ +class Connection +{ + private $host; + private $contextProviders; + private $socket; + + /** + * @param string $host The server host + * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name + */ + public function __construct(string $host, array $contextProviders = []) + { + if (false === strpos($host, '://')) { + $host = 'tcp://'.$host; + } + + $this->host = $host; + $this->contextProviders = $contextProviders; + } + + public function getContextProviders(): array + { + return $this->contextProviders; + } + + public function write(Data $data): bool + { + $socketIsFresh = !$this->socket; + if (!$this->socket = $this->socket ?: $this->createSocket()) { + return false; + } + + $context = ['timestamp' => microtime(true)]; + foreach ($this->contextProviders as $name => $provider) { + $context[$name] = $provider->getContext(); + } + $context = array_filter($context); + $encodedPayload = base64_encode(serialize([$data, $context]))."\n"; + + set_error_handler([self::class, 'nullErrorHandler']); + try { + if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { + return true; + } + if (!$socketIsFresh) { + stream_socket_shutdown($this->socket, \STREAM_SHUT_RDWR); + fclose($this->socket); + $this->socket = $this->createSocket(); + } + if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { + return true; + } + } finally { + restore_error_handler(); + } + + return false; + } + + private static function nullErrorHandler($t, $m) + { + // no-op + } + + private function createSocket() + { + set_error_handler([self::class, 'nullErrorHandler']); + try { + return stream_socket_client($this->host, $errno, $errstr, 3, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT); + } finally { + restore_error_handler(); + } + } +} diff --git a/vendor/symfony/var-dumper/Server/DumpServer.php b/vendor/symfony/var-dumper/Server/DumpServer.php new file mode 100644 index 0000000000000000000000000000000000000000..55510c0e224e6a21b703a56c102db9469ea9c1bd --- /dev/null +++ b/vendor/symfony/var-dumper/Server/DumpServer.php @@ -0,0 +1,107 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Server; + +use Psr\Log\LoggerInterface; +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * A server collecting Data clones sent by a ServerDumper. + * + * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> + * + * @final + */ +class DumpServer +{ + private $host; + private $socket; + private $logger; + + public function __construct(string $host, LoggerInterface $logger = null) + { + if (false === strpos($host, '://')) { + $host = 'tcp://'.$host; + } + + $this->host = $host; + $this->logger = $logger; + } + + public function start(): void + { + if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) { + throw new \RuntimeException(sprintf('Server start failed on "%s": ', $this->host).$errstr.' '.$errno); + } + } + + public function listen(callable $callback): void + { + if (null === $this->socket) { + $this->start(); + } + + foreach ($this->getMessages() as $clientId => $message) { + $payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]); + + // Impossible to decode the message, give up. + if (false === $payload) { + if ($this->logger) { + $this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]); + } + + continue; + } + + if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) { + if ($this->logger) { + $this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]); + } + + continue; + } + + [$data, $context] = $payload; + + $callback($data, $context, $clientId); + } + } + + public function getHost(): string + { + return $this->host; + } + + private function getMessages(): iterable + { + $sockets = [(int) $this->socket => $this->socket]; + $write = []; + + while (true) { + $read = $sockets; + stream_select($read, $write, $write, null); + + foreach ($read as $stream) { + if ($this->socket === $stream) { + $stream = stream_socket_accept($this->socket); + $sockets[(int) $stream] = $stream; + } elseif (feof($stream)) { + unset($sockets[(int) $stream]); + fclose($stream); + } else { + yield (int) $stream => fgets($stream); + } + } + } + } +} diff --git a/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php b/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php index b8f12c5e4573ab039e9bfd41da2ecf13e6c2dbfa..3d3d18eeb21eee5c9d76013fdd86bf8e968abc6a 100644 --- a/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php +++ b/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php @@ -19,26 +19,37 @@ */ trait VarDumperTestTrait { - public function assertDumpEquals($dump, $data, $filter = 0, $message = '') + /** + * @internal + */ + private $varDumperConfig = [ + 'casters' => [], + 'flags' => null, + ]; + + protected function setUpVarDumper(array $casters, int $flags = null): void { - if (\is_string($filter)) { - @trigger_error(sprintf('The $message argument of the "%s()" method at the 3rd position is deprecated since Symfony 3.4 and will be moved at the 4th position in 4.0.', __METHOD__), \E_USER_DEPRECATED); - $message = $filter; - $filter = 0; - } + $this->varDumperConfig['casters'] = $casters; + $this->varDumperConfig['flags'] = $flags; + } - $this->assertSame(rtrim($dump), $this->getDump($data, null, $filter), $message); + /** + * @after + */ + protected function tearDownVarDumper(): void + { + $this->varDumperConfig['casters'] = []; + $this->varDumperConfig['flags'] = null; } - public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '') + public function assertDumpEquals($expected, $data, $filter = 0, $message = '') { - if (\is_string($filter)) { - @trigger_error(sprintf('The $message argument of the "%s()" method at the 3rd position is deprecated since Symfony 3.4 and will be moved at the 4th position in 4.0.', __METHOD__), \E_USER_DEPRECATED); - $message = $filter; - $filter = 0; - } + $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); + } - $this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data, null, $filter), $message); + public function assertDumpMatchesFormat($expected, $data, $filter = 0, $message = '') + { + $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); } /** @@ -46,10 +57,14 @@ public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '' */ protected function getDump($data, $key = null, $filter = 0) { - $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; - $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; + if (null === $flags = $this->varDumperConfig['flags']) { + $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; + $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; + $flags |= getenv('DUMP_COMMA_SEPARATOR') ? CliDumper::DUMP_COMMA_SEPARATOR : 0; + } $cloner = new VarCloner(); + $cloner->addCasters($this->varDumperConfig['casters']); $cloner->setMaxItems(-1); $dumper = new CliDumper(null, null, $flags); $dumper->setColors(false); @@ -60,4 +75,13 @@ protected function getDump($data, $key = null, $filter = 0) return rtrim($dumper->dump($data, true)); } + + private function prepareExpectation($expected, int $filter): string + { + if (!\is_string($expected)) { + $expected = $this->getDump($expected, null, $filter); + } + + return rtrim($expected); + } } diff --git a/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php deleted file mode 100644 index 73800e5f9dc463af7b05d71ee76387a91c3b9e4b..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php +++ /dev/null @@ -1,181 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; - -/** - * @author Nicolas Grekas <p@tchwork.com> - */ -class CasterTest extends TestCase -{ - use VarDumperTestTrait; - - private $referenceArray = [ - 'null' => null, - 'empty' => false, - 'public' => 'pub', - "\0~\0virtual" => 'virt', - "\0+\0dynamic" => 'dyn', - "\0*\0protected" => 'prot', - "\0Foo\0private" => 'priv', - ]; - - /** - * @dataProvider provideFilter - */ - public function testFilter($filter, $expectedDiff, $listedProperties = null) - { - if (null === $listedProperties) { - $filteredArray = Caster::filter($this->referenceArray, $filter); - } else { - $filteredArray = Caster::filter($this->referenceArray, $filter, $listedProperties); - } - - $this->assertSame($expectedDiff, array_diff_assoc($this->referenceArray, $filteredArray)); - } - - public function provideFilter() - { - return [ - [ - 0, - [], - ], - [ - Caster::EXCLUDE_PUBLIC, - [ - 'null' => null, - 'empty' => false, - 'public' => 'pub', - ], - ], - [ - Caster::EXCLUDE_NULL, - [ - 'null' => null, - ], - ], - [ - Caster::EXCLUDE_EMPTY, - [ - 'null' => null, - 'empty' => false, - ], - ], - [ - Caster::EXCLUDE_VIRTUAL, - [ - "\0~\0virtual" => 'virt', - ], - ], - [ - Caster::EXCLUDE_DYNAMIC, - [ - "\0+\0dynamic" => 'dyn', - ], - ], - [ - Caster::EXCLUDE_PROTECTED, - [ - "\0*\0protected" => 'prot', - ], - ], - [ - Caster::EXCLUDE_PRIVATE, - [ - "\0Foo\0private" => 'priv', - ], - ], - [ - Caster::EXCLUDE_VERBOSE, - [ - 'public' => 'pub', - "\0*\0protected" => 'prot', - ], - ['public', "\0*\0protected"], - ], - [ - Caster::EXCLUDE_NOT_IMPORTANT, - [ - 'null' => null, - 'empty' => false, - "\0~\0virtual" => 'virt', - "\0+\0dynamic" => 'dyn', - "\0Foo\0private" => 'priv', - ], - ['public', "\0*\0protected"], - ], - [ - Caster::EXCLUDE_VIRTUAL | Caster::EXCLUDE_DYNAMIC, - [ - "\0~\0virtual" => 'virt', - "\0+\0dynamic" => 'dyn', - ], - ], - [ - Caster::EXCLUDE_NOT_IMPORTANT | Caster::EXCLUDE_VERBOSE, - $this->referenceArray, - ['public', "\0*\0protected"], - ], - [ - Caster::EXCLUDE_NOT_IMPORTANT | Caster::EXCLUDE_EMPTY, - [ - 'null' => null, - 'empty' => false, - "\0~\0virtual" => 'virt', - "\0+\0dynamic" => 'dyn', - "\0*\0protected" => 'prot', - "\0Foo\0private" => 'priv', - ], - ['public', 'empty'], - ], - [ - Caster::EXCLUDE_VERBOSE | Caster::EXCLUDE_EMPTY | Caster::EXCLUDE_STRICT, - [ - 'empty' => false, - ], - ['public', 'empty'], - ], - ]; - } - - /** - * @requires PHP 7.0 - */ - public function testAnonymousClass() - { - $c = eval('return new class extends stdClass { private $foo = "foo"; };'); - - $this->assertDumpMatchesFormat( - <<<'EOTXT' -stdClass@anonymous { - -foo: "foo" -} -EOTXT - , $c - ); - - $c = eval('return new class { private $foo = "foo"; };'); - - $this->assertDumpMatchesFormat( - <<<'EOTXT' -class@anonymous { - -foo: "foo" -} -EOTXT - , $c - ); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Caster/DateCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/DateCasterTest.php deleted file mode 100644 index 8c685f6b7b3e1224a8a5060902efb1d6c2a13cd9..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/DateCasterTest.php +++ /dev/null @@ -1,461 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Caster\DateCaster; -use Symfony\Component\VarDumper\Cloner\Stub; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; -use Symfony\Component\VarDumper\Tests\Fixtures\DateTimeChild; - -/** - * @author Dany Maillard <danymaillard93b@gmail.com> - */ -class DateCasterTest extends TestCase -{ - use VarDumperTestTrait; - - /** - * @dataProvider provideDateTimes - */ - public function testDumpDateTime($time, $timezone, $xDate, $xTimestamp) - { - if ((\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID <= 50509) && preg_match('/[-+]\d{2}:\d{2}/', $timezone)) { - $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); - } - - $date = new \DateTime($time, new \DateTimeZone($timezone)); - - $xDump = <<<EODUMP -DateTime @$xTimestamp { - date: $xDate -} -EODUMP; - - $this->assertDumpEquals($xDump, $date); - } - - /** - * @dataProvider provideDateTimes - */ - public function testCastDateTime($time, $timezone, $xDate, $xTimestamp, $xInfos) - { - if ((\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID <= 50509) && preg_match('/[-+]\d{2}:\d{2}/', $timezone)) { - $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); - } - - $stub = new Stub(); - $date = new \DateTime($time, new \DateTimeZone($timezone)); - $cast = DateCaster::castDateTime($date, Caster::castObject($date, \DateTime::class), $stub, false, 0); - - $xDump = <<<EODUMP -array:1 [ - "\\x00~\\x00date" => $xDate -] -EODUMP; - - $this->assertDumpEquals($xDump, $cast); - - $xDump = <<<EODUMP -Symfony\Component\VarDumper\Caster\ConstStub { - +type: 1 - +class: "$xDate" - +value: "%A$xInfos%A" - +cut: 0 - +handle: 0 - +refCount: 0 - +position: 0 - +attr: [] -} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $cast["\0~\0date"]); - } - - public function provideDateTimes() - { - return [ - ['2017-04-30 00:00:00.000000', 'Europe/Zurich', '2017-04-30 00:00:00.0 Europe/Zurich (+02:00)', 1493503200, 'Sunday, April 30, 2017%Afrom now%ADST On'], - ['2017-12-31 00:00:00.000000', 'Europe/Zurich', '2017-12-31 00:00:00.0 Europe/Zurich (+01:00)', 1514674800, 'Sunday, December 31, 2017%Afrom now%ADST Off'], - ['2017-04-30 00:00:00.000000', '+02:00', '2017-04-30 00:00:00.0 +02:00', 1493503200, 'Sunday, April 30, 2017%Afrom now'], - - ['2017-04-30 00:00:00.100000', '+00:00', '2017-04-30 00:00:00.100 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'], - ['2017-04-30 00:00:00.120000', '+00:00', '2017-04-30 00:00:00.120 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'], - ['2017-04-30 00:00:00.123000', '+00:00', '2017-04-30 00:00:00.123 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'], - ['2017-04-30 00:00:00.123400', '+00:00', '2017-04-30 00:00:00.123400 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'], - ['2017-04-30 00:00:00.123450', '+00:00', '2017-04-30 00:00:00.123450 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'], - ['2017-04-30 00:00:00.123456', '+00:00', '2017-04-30 00:00:00.123456 +00:00', 1493510400, 'Sunday, April 30, 2017%Afrom now'], - ]; - } - - public function testCastDateTimeWithAdditionalChildProperty() - { - $stub = new Stub(); - $date = new DateTimeChild('2020-02-13 00:00:00.123456', new \DateTimeZone('Europe/Paris')); - $objectCast = Caster::castObject($date, DateTimeChild::class); - $dateCast = DateCaster::castDateTime($date, $objectCast, $stub, false, 0); - - $xDate = '2020-02-13 00:00:00.123456 Europe/Paris (+01:00)'; - $xInfo = 'Thursday, February 13, 2020%Afrom now'; - $xDump = <<<EODUMP -array:2 [ - "\\x00Symfony\Component\VarDumper\Tests\Fixtures\DateTimeChild\\x00addedProperty" => "foo" - "\\x00~\\x00date" => $xDate -] -EODUMP; - - $this->assertDumpEquals($xDump, $dateCast); - - $xDump = <<<EODUMP -Symfony\Component\VarDumper\Caster\ConstStub { - +type: 1 - +class: "$xDate" - +value: "%A$xInfo%A" - +cut: 0 - +handle: 0 - +refCount: 0 - +position: 0 - +attr: [] -} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $dateCast["\0~\0date"]); - } - - /** - * @dataProvider provideIntervals - */ - public function testDumpInterval($intervalSpec, $ms, $invert, $expected) - { - if ($ms && \PHP_VERSION_ID >= 70200 && version_compare(\PHP_VERSION, '7.2.0rc3', '<=')) { - $this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.'); - } - - $interval = $this->createInterval($intervalSpec, $ms, $invert); - - $xDump = <<<EODUMP -DateInterval { - interval: $expected -%A} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $interval); - } - - /** - * @dataProvider provideIntervals - */ - public function testDumpIntervalExcludingVerbosity($intervalSpec, $ms, $invert, $expected) - { - if ($ms && \PHP_VERSION_ID >= 70200 && version_compare(\PHP_VERSION, '7.2.0rc3', '<=')) { - $this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.'); - } - - $interval = $this->createInterval($intervalSpec, $ms, $invert); - - $xDump = <<<EODUMP -DateInterval { - interval: $expected -} -EODUMP; - - $this->assertDumpEquals($xDump, $interval, Caster::EXCLUDE_VERBOSE); - } - - /** - * @dataProvider provideIntervals - */ - public function testCastInterval($intervalSpec, $ms, $invert, $xInterval, $xSeconds) - { - if ($ms && \PHP_VERSION_ID >= 70200 && version_compare(\PHP_VERSION, '7.2.0rc3', '<=')) { - $this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.'); - } - - $interval = $this->createInterval($intervalSpec, $ms, $invert); - $stub = new Stub(); - - $cast = DateCaster::castInterval($interval, ['foo' => 'bar'], $stub, false, Caster::EXCLUDE_VERBOSE); - - $xDump = <<<EODUMP -array:1 [ - "\\x00~\\x00interval" => $xInterval -] -EODUMP; - - $this->assertDumpEquals($xDump, $cast); - - if (null === $xSeconds) { - return; - } - - $xDump = <<<EODUMP -Symfony\Component\VarDumper\Caster\ConstStub { - +type: 1 - +class: "$xInterval" - +value: "$xSeconds" - +cut: 0 - +handle: 0 - +refCount: 0 - +position: 0 - +attr: [] -} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $cast["\0~\0interval"]); - } - - public function provideIntervals() - { - $i = new \DateInterval('PT0S'); - $ms = ($withMs = \PHP_VERSION_ID >= 70100 && isset($i->f)) ? '.0' : ''; - - return [ - ['PT0S', 0, 0, '0s', '0s'], - ['PT0S', 0.1, 0, $withMs ? '+ 00:00:00.100' : '0s', '%is'], - ['PT1S', 0, 0, '+ 00:00:01'.$ms, '%is'], - ['PT2M', 0, 0, '+ 00:02:00'.$ms, '%is'], - ['PT3H', 0, 0, '+ 03:00:00'.$ms, '%ss'], - ['P4D', 0, 0, '+ 4d', '%ss'], - ['P5M', 0, 0, '+ 5m', null], - ['P6Y', 0, 0, '+ 6y', null], - ['P1Y2M3DT4H5M6S', 0, 0, '+ 1y 2m 3d 04:05:06'.$ms, null], - ['PT1M60S', 0, 0, '+ 00:02:00'.$ms, null], - ['PT1H60M', 0, 0, '+ 02:00:00'.$ms, null], - ['P1DT24H', 0, 0, '+ 2d', null], - ['P1M32D', 0, 0, '+ 1m 32d', null], - - ['PT0S', 0, 1, '0s', '0s'], - ['PT0S', 0.1, 1, $withMs ? '- 00:00:00.100' : '0s', '%is'], - ['PT1S', 0, 1, '- 00:00:01'.$ms, '%is'], - ['PT2M', 0, 1, '- 00:02:00'.$ms, '%is'], - ['PT3H', 0, 1, '- 03:00:00'.$ms, '%ss'], - ['P4D', 0, 1, '- 4d', '%ss'], - ['P5M', 0, 1, '- 5m', null], - ['P6Y', 0, 1, '- 6y', null], - ['P1Y2M3DT4H5M6S', 0, 1, '- 1y 2m 3d 04:05:06'.$ms, null], - ['PT1M60S', 0, 1, '- 00:02:00'.$ms, null], - ['PT1H60M', 0, 1, '- 02:00:00'.$ms, null], - ['P1DT24H', 0, 1, '- 2d', null], - ['P1M32D', 0, 1, '- 1m 32d', null], - ]; - } - - /** - * @dataProvider provideTimeZones - */ - public function testDumpTimeZone($timezone, $expected) - { - if ((\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) { - $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); - } - - $timezone = new \DateTimeZone($timezone); - - $xDump = <<<EODUMP -DateTimeZone { - timezone: $expected -%A} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $timezone); - } - - /** - * @dataProvider provideTimeZones - */ - public function testDumpTimeZoneExcludingVerbosity($timezone, $expected) - { - if ((\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) { - $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); - } - - $timezone = new \DateTimeZone($timezone); - - $xDump = <<<EODUMP -DateTimeZone { - timezone: $expected -} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $timezone, Caster::EXCLUDE_VERBOSE); - } - - /** - * @dataProvider provideTimeZones - */ - public function testCastTimeZone($timezone, $xTimezone, $xRegion) - { - if ((\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) { - $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); - } - - $timezone = new \DateTimeZone($timezone); - $stub = new Stub(); - - $cast = DateCaster::castTimeZone($timezone, ['foo' => 'bar'], $stub, false, Caster::EXCLUDE_VERBOSE); - - $xDump = <<<EODUMP -array:1 [ - "\\x00~\\x00timezone" => $xTimezone -] -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $cast); - - $xDump = <<<EODUMP -Symfony\Component\VarDumper\Caster\ConstStub { - +type: 1 - +class: "$xTimezone" - +value: "$xRegion" - +cut: 0 - +handle: 0 - +refCount: 0 - +position: 0 - +attr: [] -} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $cast["\0~\0timezone"]); - } - - public function provideTimeZones() - { - $xRegion = \extension_loaded('intl') ? '%s' : ''; - - return [ - // type 1 (UTC offset) - ['-12:00', '-12:00', ''], - ['+00:00', '+00:00', ''], - ['+14:00', '+14:00', ''], - - // type 2 (timezone abbreviation) - ['GMT', '+00:00', ''], - ['a', '+01:00', ''], - ['b', '+02:00', ''], - ['z', '+00:00', ''], - - // type 3 (timezone identifier) - ['Africa/Tunis', 'Africa/Tunis (%s:00)', $xRegion], - ['America/Panama', 'America/Panama (%s:00)', $xRegion], - ['Asia/Jerusalem', 'Asia/Jerusalem (%s:00)', $xRegion], - ['Atlantic/Canary', 'Atlantic/Canary (%s:00)', $xRegion], - ['Australia/Perth', 'Australia/Perth (%s:00)', $xRegion], - ['Europe/Zurich', 'Europe/Zurich (%s:00)', $xRegion], - ['Pacific/Tahiti', 'Pacific/Tahiti (%s:00)', $xRegion], - ]; - } - - /** - * @dataProvider providePeriods - */ - public function testDumpPeriod($start, $interval, $end, $options, $expected) - { - if (\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) { - $this->markTestSkipped(); - } - - $p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), \is_int($end) ? $end : new \DateTime($end), $options); - - $xDump = <<<EODUMP -DatePeriod { - period: $expected -%A} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $p); - } - - /** - * @dataProvider providePeriods - */ - public function testCastPeriod($start, $interval, $end, $options, $xPeriod, $xDates) - { - if (\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) { - $this->markTestSkipped(); - } - - $p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), \is_int($end) ? $end : new \DateTime($end), $options); - $stub = new Stub(); - - $cast = DateCaster::castPeriod($p, [], $stub, false, 0); - - $xDump = <<<EODUMP -array:1 [ - "\\x00~\\x00period" => $xPeriod -] -EODUMP; - - $this->assertDumpEquals($xDump, $cast); - - $xDump = <<<EODUMP -Symfony\Component\VarDumper\Caster\ConstStub { - +type: 1 - +class: "$xPeriod" - +value: "%A$xDates%A" - +cut: 0 - +handle: 0 - +refCount: 0 - +position: 0 - +attr: [] -} -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $cast["\0~\0period"]); - } - - public function providePeriods() - { - $i = new \DateInterval('PT0S'); - $ms = \PHP_VERSION_ID >= 70100 && isset($i->f) ? '.0' : ''; - - $periods = [ - ['2017-01-01', 'P1D', '2017-01-03', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-03 00:00:00.0', '1) 2017-01-01%a2) 2017-01-02'], - ['2017-01-01', 'P1D', 1, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 2 time/s', '1) 2017-01-01%a2) 2017-01-02'], - - ['2017-01-01', 'P1D', '2017-01-04', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-04 00:00:00.0', '1) 2017-01-01%a2) 2017-01-02%a3) 2017-01-03'], - ['2017-01-01', 'P1D', 2, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 3 time/s', '1) 2017-01-01%a2) 2017-01-02%a3) 2017-01-03'], - - ['2017-01-01', 'P1D', '2017-01-05', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-05 00:00:00.0', '1) 2017-01-01%a2) 2017-01-02%a1 more'], - ['2017-01-01', 'P1D', 3, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 4 time/s', '1) 2017-01-01%a2) 2017-01-02%a3) 2017-01-03%a1 more'], - - ['2017-01-01', 'P1D', '2017-01-21', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-21 00:00:00.0', '1) 2017-01-01%a17 more'], - ['2017-01-01', 'P1D', 19, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 20 time/s', '1) 2017-01-01%a17 more'], - - ['2017-01-01 01:00:00', 'P1D', '2017-01-03 01:00:00', 0, 'every + 1d, from 2017-01-01 01:00:00.0 (included) to 2017-01-03 01:00:00.0', '1) 2017-01-01 01:00:00.0%a2) 2017-01-02 01:00:00.0'], - ['2017-01-01 01:00:00', 'P1D', 1, 0, 'every + 1d, from 2017-01-01 01:00:00.0 (included) recurring 2 time/s', '1) 2017-01-01 01:00:00.0%a2) 2017-01-02 01:00:00.0'], - - ['2017-01-01', 'P1DT1H', '2017-01-03', 0, "every + 1d 01:00:00$ms, from 2017-01-01 00:00:00.0 (included) to 2017-01-03 00:00:00.0", '1) 2017-01-01 00:00:00.0%a2) 2017-01-02 01:00:00.0'], - ['2017-01-01', 'P1DT1H', 1, 0, "every + 1d 01:00:00$ms, from 2017-01-01 00:00:00.0 (included) recurring 2 time/s", '1) 2017-01-01 00:00:00.0%a2) 2017-01-02 01:00:00.0'], - - ['2017-01-01', 'P1D', '2017-01-04', \DatePeriod::EXCLUDE_START_DATE, 'every + 1d, from 2017-01-01 00:00:00.0 (excluded) to 2017-01-04 00:00:00.0', '1) 2017-01-02%a2) 2017-01-03'], - ['2017-01-01', 'P1D', 2, \DatePeriod::EXCLUDE_START_DATE, 'every + 1d, from 2017-01-01 00:00:00.0 (excluded) recurring 2 time/s', '1) 2017-01-02%a2) 2017-01-03'], - ]; - - if (\PHP_VERSION_ID < 70107) { - array_walk($periods, function (&$i) { $i[5] = ''; }); - } - - return $periods; - } - - private function createInterval($intervalSpec, $ms, $invert) - { - $interval = new \DateInterval($intervalSpec); - if (\PHP_VERSION_ID >= 70100 && isset($interval->f)) { - $interval->f = $ms; - } - $interval->invert = $invert; - - return $interval; - } -} diff --git a/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php deleted file mode 100644 index 738180f5b22dc8db1d298377d0a7a69329e91a08..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php +++ /dev/null @@ -1,227 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Caster\ExceptionCaster; -use Symfony\Component\VarDumper\Caster\FrameStub; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; - -class ExceptionCasterTest extends TestCase -{ - use VarDumperTestTrait; - - private function getTestException($msg, &$ref = null) - { - return new \Exception(''.$msg); - } - - protected function tearDown() - { - ExceptionCaster::$srcContext = 1; - ExceptionCaster::$traceArgs = true; - } - - public function testDefaultSettings() - { - $ref = ['foo']; - $e = $this->getTestException('foo', $ref); - - $expectedDump = <<<'EODUMP' -Exception { - #message: "foo" - #code: 0 - #file: "%sExceptionCasterTest.php" - #line: 28 - trace: { - %s%eTests%eCaster%eExceptionCasterTest.php:28 { - › { - › return new \Exception(''.$msg); - › } - } - %s%eTests%eCaster%eExceptionCasterTest.php:40 { …} -%A -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $e); - $this->assertSame(['foo'], $ref); - } - - public function testSeek() - { - $e = $this->getTestException(2); - - $expectedDump = <<<'EODUMP' -{ - %s%eTests%eCaster%eExceptionCasterTest.php:28 { - › { - › return new \Exception(''.$msg); - › } - } - %s%eTests%eCaster%eExceptionCasterTest.php:64 { …} -%A -EODUMP; - - $this->assertStringMatchesFormat($expectedDump, $this->getDump($e, 'trace')); - } - - public function testNoArgs() - { - $e = $this->getTestException(1); - ExceptionCaster::$traceArgs = false; - - $expectedDump = <<<'EODUMP' -Exception { - #message: "1" - #code: 0 - #file: "%sExceptionCasterTest.php" - #line: 28 - trace: { - %sExceptionCasterTest.php:28 { - › { - › return new \Exception(''.$msg); - › } - } - %s%eTests%eCaster%eExceptionCasterTest.php:82 { …} -%A -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $e); - } - - public function testNoSrcContext() - { - $e = $this->getTestException(1); - ExceptionCaster::$srcContext = -1; - - $expectedDump = <<<'EODUMP' -Exception { - #message: "1" - #code: 0 - #file: "%sExceptionCasterTest.php" - #line: 28 - trace: { - %s%eTests%eCaster%eExceptionCasterTest.php:28 - %s%eTests%eCaster%eExceptionCasterTest.php:%d -%A -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $e); - } - - public function testHtmlDump() - { - if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) { - $this->markTestSkipped('A custom file_link_format is defined.'); - } - - $e = $this->getTestException(1); - ExceptionCaster::$srcContext = -1; - - $cloner = new VarCloner(); - $cloner->setMaxItems(1); - $dumper = new HtmlDumper(); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $dump = $dumper->dump($cloner->cloneVar($e)->withRefHandles(false), true); - - $expectedDump = <<<'EODUMP' -<foo></foo><bar><span class=sf-dump-note>Exception</span> {<samp> - #<span class=sf-dump-protected title="Protected property">message</span>: "<span class=sf-dump-str>1</span>" - #<span class=sf-dump-protected title="Protected property">code</span>: <span class=sf-dump-num>0</span> - #<span class=sf-dump-protected title="Protected property">file</span>: "<span class=sf-dump-str title="%sExceptionCasterTest.php -%d characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eCaster%eExceptionCasterTest.php</span>" - #<span class=sf-dump-protected title="Protected property">line</span>: <span class=sf-dump-num>28</span> - <span class=sf-dump-meta>trace</span>: {<samp> - <span class=sf-dump-meta title="%sExceptionCasterTest.php -Stack level %d."><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eCaster%eExceptionCasterTest.php</span>:<span class=sf-dump-num>28</span> - …%d - </samp>} -</samp>} -</bar> -EODUMP; - - $this->assertStringMatchesFormat($expectedDump, $dump); - } - - /** - * @requires function Twig\Template::getSourceContext - */ - public function testFrameWithTwig() - { - require_once \dirname(__DIR__).'/Fixtures/Twig.php'; - - $f = [ - new FrameStub([ - 'file' => \dirname(__DIR__).'/Fixtures/Twig.php', - 'line' => 20, - 'class' => '__TwigTemplate_VarDumperFixture_u75a09', - ]), - new FrameStub([ - 'file' => \dirname(__DIR__).'/Fixtures/Twig.php', - 'line' => 21, - 'class' => '__TwigTemplate_VarDumperFixture_u75a09', - 'object' => new \__TwigTemplate_VarDumperFixture_u75a09(null, __FILE__), - ]), - ]; - - $expectedDump = <<<'EODUMP' -array:2 [ - 0 => { - class: "__TwigTemplate_VarDumperFixture_u75a09" - src: { - %sTwig.php:1 { - › - › foo bar - › twig source - } - } - } - 1 => { - class: "__TwigTemplate_VarDumperFixture_u75a09" - object: __TwigTemplate_VarDumperFixture_u75a09 { - %A - } - src: { - %sExceptionCasterTest.php:2 { - › foo bar - › twig source - › - } - } - } -] - -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $f); - } - - public function testExcludeVerbosity() - { - $e = $this->getTestException('foo'); - - $expectedDump = <<<'EODUMP' -Exception { - #message: "foo" - #code: 0 - #file: "%sExceptionCasterTest.php" - #line: 28 -} -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $e, Caster::EXCLUDE_VERBOSE); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php deleted file mode 100644 index fca242cfc6e9f91f48b33907f8c76cc91a43d7bc..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Caster\PdoCaster; -use Symfony\Component\VarDumper\Cloner\Stub; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; - -/** - * @author Nicolas Grekas <p@tchwork.com> - */ -class PdoCasterTest extends TestCase -{ - use VarDumperTestTrait; - - /** - * @requires extension pdo_sqlite - */ - public function testCastPdo() - { - $pdo = new \PDO('sqlite::memory:'); - $pdo->setAttribute(\PDO::ATTR_STATEMENT_CLASS, ['PDOStatement', [$pdo]]); - $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - - $cast = PdoCaster::castPdo($pdo, [], new Stub(), false); - - $this->assertInstanceOf('Symfony\Component\VarDumper\Caster\EnumStub', $cast["\0~\0attributes"]); - - $attr = $cast["\0~\0attributes"] = $cast["\0~\0attributes"]->value; - $this->assertInstanceOf('Symfony\Component\VarDumper\Caster\ConstStub', $attr['CASE']); - $this->assertSame('NATURAL', $attr['CASE']->class); - $this->assertSame('BOTH', $attr['DEFAULT_FETCH_MODE']->class); - - $xDump = <<<'EODUMP' -array:2 [ - "\x00~\x00inTransaction" => false - "\x00~\x00attributes" => array:9 [ - "CASE" => NATURAL - "ERRMODE" => EXCEPTION - "PERSISTENT" => false - "DRIVER_NAME" => "sqlite" - "ORACLE_NULLS" => NATURAL - "CLIENT_VERSION" => "%s" - "SERVER_VERSION" => "%s" - "STATEMENT_CLASS" => array:%d [ - 0 => "PDOStatement"%A - ] - "DEFAULT_FETCH_MODE" => BOTH - ] -] -EODUMP; - - $this->assertDumpMatchesFormat($xDump, $cast); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php deleted file mode 100644 index ed14494ec8509382b381c4c2edf9399be427594f..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; - -/** - * @author Nicolas Grekas <p@tchwork.com> - * @requires extension redis - */ -class RedisCasterTest extends TestCase -{ - use VarDumperTestTrait; - - public function testNotConnected() - { - $redis = new \Redis(); - - if (\defined('HHVM_VERSION_ID')) { - $xCast = <<<'EODUMP' -Redis { - #host: "" -%A -} -EODUMP; - } else { - $xCast = <<<'EODUMP' -Redis { - isConnected: false -} -EODUMP; - } - - $this->assertDumpMatchesFormat($xCast, $redis); - } - - public function testConnected() - { - $redis = new \Redis(); - if (!@$redis->connect('127.0.0.1')) { - $e = error_get_last(); - self::markTestSkipped($e['message']); - } - - if (\defined('HHVM_VERSION_ID')) { - $xCast = <<<'EODUMP' -Redis { - #host: "127.0.0.1" -%A -} -EODUMP; - } else { - $xCast = <<<'EODUMP' -Redis {%A - isConnected: true - host: "127.0.0.1" - port: 6379 - auth: null - dbNum: 0 - timeout: 0.0 - persistentId: null - options: { - READ_TIMEOUT: 0.0 - SERIALIZER: NONE - PREFIX: null - SCAN: NORETRY - } -} -EODUMP; - } - - $this->assertDumpMatchesFormat($xCast, $redis); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php deleted file mode 100644 index 17ad5434beec26cdc5add898dd9e6701641feb4b..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php +++ /dev/null @@ -1,270 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; -use Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo; -use Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass; - -/** - * @author Nicolas Grekas <p@tchwork.com> - */ -class ReflectionCasterTest extends TestCase -{ - use VarDumperTestTrait; - - public function testReflectionCaster() - { - $var = new \ReflectionClass('ReflectionClass'); - - $this->assertDumpMatchesFormat( - <<<'EOTXT' -ReflectionClass { - +name: "ReflectionClass" -%Aimplements: array:%d [ - 0 => "Reflector" -%A] - constants: array:3 [ - "IS_IMPLICIT_ABSTRACT" => 16 - "IS_EXPLICIT_ABSTRACT" => %d - "IS_FINAL" => %d - ] - properties: array:%d [ - "name" => ReflectionProperty { -%A +name: "name" - +class: "ReflectionClass" -%A modifiers: "public" - } -%A] - methods: array:%d [ -%A - "__construct" => ReflectionMethod { - +name: "__construct" - +class: "ReflectionClass" -%A parameters: { - $%s: ReflectionParameter { -%A position: 0 -%A -} -EOTXT - , $var - ); - } - - public function testClosureCaster() - { - $a = $b = 123; - $var = function ($x) use ($a, &$b) {}; - - $this->assertDumpMatchesFormat( - <<<EOTXT -Closure { -%Aparameters: { - \$x: {} - } - use: { - \$a: 123 - \$b: & 123 - } - file: "%sReflectionCasterTest.php" - line: "68 to 68" -} -EOTXT - , $var - ); - } - - public function testFromCallableClosureCaster() - { - if (\defined('HHVM_VERSION_ID')) { - $this->markTestSkipped('Not for HHVM.'); - } - $var = [ - (new \ReflectionMethod($this, __FUNCTION__))->getClosure($this), - (new \ReflectionMethod(__CLASS__, 'tearDownAfterClass'))->getClosure(), - ]; - - $this->assertDumpMatchesFormat( - <<<EOTXT -array:2 [ - 0 => Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest::testFromCallableClosureCaster { - this: Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest { …} - file: "%sReflectionCasterTest.php" - line: "%d to %d" - } - 1 => %sTestCase::tearDownAfterClass { - file: "%sTestCase.php" - line: "%d to %d" - } -] -EOTXT - , $var - ); - } - - public function testClosureCasterExcludingVerbosity() - { - $var = function () {}; - - $expectedDump = <<<EOTXT -Closure { - class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest" - this: Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest { …} -} -EOTXT; - - $this->assertDumpEquals($expectedDump, $var, Caster::EXCLUDE_VERBOSE); - } - - public function testReflectionParameter() - { - $var = new \ReflectionParameter(reflectionParameterFixture::class, 0); - - $this->assertDumpMatchesFormat( - <<<'EOTXT' -ReflectionParameter { - +name: "arg1" - position: 0 - typeHint: "Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass" - default: null -} -EOTXT - , $var - ); - } - - /** - * @requires PHP 7.0 - */ - public function testReflectionParameterScalar() - { - $f = eval('return function (int $a) {};'); - $var = new \ReflectionParameter($f, 0); - - $this->assertDumpMatchesFormat( - <<<'EOTXT' -ReflectionParameter { - +name: "a" - position: 0 - typeHint: "int" -} -EOTXT - , $var - ); - } - - /** - * @requires PHP 7.0 - */ - public function testReturnType() - { - $f = eval('return function ():int {};'); - $line = __LINE__ - 1; - - $this->assertDumpMatchesFormat( - <<<EOTXT -Closure { - returnType: "int" - class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest" - this: Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest { …} - file: "%sReflectionCasterTest.php($line) : eval()'d code" - line: "1 to 1" -} -EOTXT - , $f - ); - } - - /** - * @requires PHP 7.0 - */ - public function testGenerator() - { - if (\extension_loaded('xdebug')) { - $this->markTestSkipped('xdebug is active'); - } - - $generator = new GeneratorDemo(); - $generator = $generator->baz(); - - $expectedDump = <<<'EODUMP' -Generator { - this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …} - executing: { - Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz() { - %sGeneratorDemo.php:14 { - › { - › yield from bar(); - › } - } - } - } - closed: false -} -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $generator); - - foreach ($generator as $v) { - break; - } - - $expectedDump = <<<'EODUMP' -array:2 [ - 0 => ReflectionGenerator { - this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …} - trace: { - %s%eTests%eFixtures%eGeneratorDemo.php:9 { - › { - › yield 1; - › } - } - %s%eTests%eFixtures%eGeneratorDemo.php:20 { …} - %s%eTests%eFixtures%eGeneratorDemo.php:14 { …} - } - closed: false - } - 1 => Generator { - executing: { - Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo() { - %sGeneratorDemo.php:10 { - › yield 1; - › } - › - } - } - } - closed: false - } -] -EODUMP; - - $r = new \ReflectionGenerator($generator); - $this->assertDumpMatchesFormat($expectedDump, [$r, $r->getExecutingGenerator()]); - - foreach ($generator as $v) { - } - - $expectedDump = <<<'EODUMP' -Generator { - closed: true -} -EODUMP; - $this->assertDumpMatchesFormat($expectedDump, $generator); - } -} - -function reflectionParameterFixture(NotLoadableClass $arg1 = null, $arg2) -{ -} diff --git a/vendor/symfony/var-dumper/Tests/Caster/SplCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/SplCasterTest.php deleted file mode 100644 index a8c37faf3f346830aefd5e2714a47dee393d5ddf..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/SplCasterTest.php +++ /dev/null @@ -1,238 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; - -/** - * @author Grégoire Pineau <lyrixx@lyrixx.info> - */ -class SplCasterTest extends TestCase -{ - use VarDumperTestTrait; - - public function getCastFileInfoTests() - { - return [ - [__FILE__, <<<'EOTXT' -SplFileInfo { -%Apath: "%sCaster" - filename: "SplCasterTest.php" - basename: "SplCasterTest.php" - pathname: "%sSplCasterTest.php" - extension: "php" - realPath: "%sSplCasterTest.php" - aTime: %s-%s-%d %d:%d:%d - mTime: %s-%s-%d %d:%d:%d - cTime: %s-%s-%d %d:%d:%d - inode: %i - size: %d - perms: 0%d - owner: %d - group: %d - type: "file" - writable: true - readable: true - executable: false - file: true - dir: false - link: false -%A} -EOTXT - ], - ['https://example.com/about', <<<'EOTXT' -SplFileInfo { -%Apath: "https://example.com" - filename: "about" - basename: "about" - pathname: "https://example.com/about" - extension: "" - realPath: false -%A} -EOTXT - ], - ]; - } - - /** @dataProvider getCastFileInfoTests */ - public function testCastFileInfo($file, $dump) - { - $this->assertDumpMatchesFormat($dump, new \SplFileInfo($file)); - } - - public function testCastFileObject() - { - $var = new \SplFileObject(__FILE__); - $var->setFlags(\SplFileObject::DROP_NEW_LINE | \SplFileObject::SKIP_EMPTY); - $dump = <<<'EOTXT' -SplFileObject { -%Apath: "%sCaster" - filename: "SplCasterTest.php" - basename: "SplCasterTest.php" - pathname: "%sSplCasterTest.php" - extension: "php" - realPath: "%sSplCasterTest.php" - aTime: %s-%s-%d %d:%d:%d - mTime: %s-%s-%d %d:%d:%d - cTime: %s-%s-%d %d:%d:%d - inode: %i - size: %d - perms: 0%d - owner: %d - group: %d - type: "file" - writable: true - readable: true - executable: false - file: true - dir: false - link: false -%AcsvControl: array:%d [ - 0 => "," - 1 => """ -%A] - flags: DROP_NEW_LINE|SKIP_EMPTY - maxLineLen: 0 - fstat: array:26 [ - "dev" => %d - "ino" => %i - "nlink" => %d - "rdev" => 0 - "blksize" => %i - "blocks" => %i - …20 - ] - eof: false - key: 0 -} -EOTXT; - $this->assertDumpMatchesFormat($dump, $var); - } - - /** - * @dataProvider provideCastSplDoublyLinkedList - */ - public function testCastSplDoublyLinkedList($modeValue, $modeDump) - { - $var = new \SplDoublyLinkedList(); - $var->setIteratorMode($modeValue); - $dump = <<<EOTXT -SplDoublyLinkedList { -%Amode: $modeDump - dllist: [] -} -EOTXT; - $this->assertDumpMatchesFormat($dump, $var); - } - - public function provideCastSplDoublyLinkedList() - { - return [ - [\SplDoublyLinkedList::IT_MODE_FIFO, 'IT_MODE_FIFO | IT_MODE_KEEP'], - [\SplDoublyLinkedList::IT_MODE_LIFO, 'IT_MODE_LIFO | IT_MODE_KEEP'], - [\SplDoublyLinkedList::IT_MODE_FIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_FIFO | IT_MODE_DELETE'], - [\SplDoublyLinkedList::IT_MODE_LIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_LIFO | IT_MODE_DELETE'], - ]; - } - - public function testCastObjectStorageIsntModified() - { - $var = new \SplObjectStorage(); - $var->attach(new \stdClass()); - $var->rewind(); - $current = $var->current(); - - $this->assertDumpMatchesFormat('%A', $var); - $this->assertSame($current, $var->current()); - } - - public function testCastObjectStorageDumpsInfo() - { - $var = new \SplObjectStorage(); - $var->attach(new \stdClass(), new \DateTime()); - - $this->assertDumpMatchesFormat('%ADateTime%A', $var); - } - - public function testCastArrayObject() - { - if (\defined('HHVM_VERSION')) { - $this->markTestSkipped('HHVM as different internal details.'); - } - $var = new \ArrayObject([123]); - $var->foo = 234; - - $expected = <<<EOTXT -ArrayObject { - +"foo": 234 - -storage: array:1 [ - 0 => 123 - ] - flag::STD_PROP_LIST: false - flag::ARRAY_AS_PROPS: false - iteratorClass: "ArrayIterator" -} -EOTXT; - if (\PHP_VERSION_ID < 70400) { - $expected = str_replace('-storage:', 'storage:', $expected); - } - $this->assertDumpEquals($expected, $var); - } - - public function testArrayIterator() - { - if (\defined('HHVM_VERSION')) { - $this->markTestSkipped('HHVM as different internal details.'); - } - $var = new MyArrayIterator([234]); - - $expected = <<<EOTXT -Symfony\Component\VarDumper\Tests\Caster\MyArrayIterator { - -foo: 123 - -storage: array:1 [ - 0 => 234 - ] - flag::STD_PROP_LIST: false - flag::ARRAY_AS_PROPS: false -} -EOTXT; - if (\PHP_VERSION_ID < 70400) { - $expected = str_replace('-storage:', 'storage:', $expected); - } - $this->assertDumpEquals($expected, $var); - } - - public function testBadSplFileInfo() - { - $var = new BadSplFileInfo(); - - $expected = <<<EOTXT -Symfony\Component\VarDumper\Tests\Caster\BadSplFileInfo { - ⚠: "The parent constructor was not called: the object is in an invalid state" -} -EOTXT; - $this->assertDumpEquals($expected, $var); - } -} - -class MyArrayIterator extends \ArrayIterator -{ - private $foo = 123; -} - -class BadSplFileInfo extends \SplFileInfo -{ - public function __construct() - { - } -} diff --git a/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php deleted file mode 100644 index 945833ebca683dd8eadc6501acc1305177481e33..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php +++ /dev/null @@ -1,192 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Caster\ArgsStub; -use Symfony\Component\VarDumper\Caster\ClassStub; -use Symfony\Component\VarDumper\Caster\LinkStub; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; -use Symfony\Component\VarDumper\Tests\Fixtures\FooInterface; - -class StubCasterTest extends TestCase -{ - use VarDumperTestTrait; - - public function testArgsStubWithDefaults($foo = 234, $bar = 456) - { - $args = [new ArgsStub([123], __FUNCTION__, __CLASS__)]; - - $expectedDump = <<<'EODUMP' -array:1 [ - 0 => { - $foo: 123 - } -] -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $args); - } - - public function testArgsStubWithExtraArgs($foo = 234) - { - $args = [new ArgsStub([123, 456], __FUNCTION__, __CLASS__)]; - - $expectedDump = <<<'EODUMP' -array:1 [ - 0 => { - $foo: 123 - ...: { - 456 - } - } -] -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $args); - } - - public function testArgsStubNoParamWithExtraArgs() - { - $args = [new ArgsStub([123], __FUNCTION__, __CLASS__)]; - - $expectedDump = <<<'EODUMP' -array:1 [ - 0 => { - 123 - } -] -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $args); - } - - public function testArgsStubWithClosure() - { - $args = [new ArgsStub([123], '{closure}', null)]; - - $expectedDump = <<<'EODUMP' -array:1 [ - 0 => { - 123 - } -] -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $args); - } - - public function testLinkStub() - { - $var = [new LinkStub(__CLASS__, 0, __FILE__)]; - - $cloner = new VarCloner(); - $dumper = new HtmlDumper(); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $dumper->setDisplayOptions(['fileLinkFormat' => '%f:%l']); - $dump = $dumper->dump($cloner->cloneVar($var), true); - - $expectedDump = <<<'EODUMP' -<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp> - <span class=sf-dump-index>0</span> => "<a href="%sStubCasterTest.php:0" rel="noopener noreferrer"><span class=sf-dump-str title="55 characters">Symfony\Component\VarDumper\Tests\Caster\StubCasterTest</span></a>" -</samp>] -</bar> -EODUMP; - - $this->assertStringMatchesFormat($expectedDump, $dump); - } - - public function testLinkStubWithNoFileLink() - { - $var = [new LinkStub('example.com', 0, 'http://example.com')]; - - $cloner = new VarCloner(); - $dumper = new HtmlDumper(); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $dumper->setDisplayOptions(['fileLinkFormat' => '%f:%l']); - $dump = $dumper->dump($cloner->cloneVar($var), true); - - $expectedDump = <<<'EODUMP' -<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp> - <span class=sf-dump-index>0</span> => "<a href="http://example.com" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="11 characters">example.com</span></a>" -</samp>] -</bar> -EODUMP; - - $this->assertStringMatchesFormat($expectedDump, $dump); - } - - public function testClassStub() - { - $var = [new ClassStub('hello', [FooInterface::class, 'foo'])]; - - $cloner = new VarCloner(); - $dumper = new HtmlDumper(); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $dump = $dumper->dump($cloner->cloneVar($var), true, ['fileLinkFormat' => '%f:%l']); - - $expectedDump = <<<'EODUMP' -<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp> - <span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:10" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>" -</samp>] -</bar> -EODUMP; - - $this->assertStringMatchesFormat($expectedDump, $dump); - } - - public function testClassStubWithNotExistingClass() - { - $var = [new ClassStub(NotExisting::class)]; - - $cloner = new VarCloner(); - $dumper = new HtmlDumper(); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $dump = $dumper->dump($cloner->cloneVar($var), true); - - $expectedDump = <<<'EODUMP' -<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp> - <span class=sf-dump-index>0</span> => "<span class=sf-dump-str title="Symfony\Component\VarDumper\Tests\Caster\NotExisting -52 characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-class">Symfony\Component\VarDumper\Tests\Caster</span><span class=sf-dump-ellipsis>\</span>NotExisting</span>" -</samp>] -</bar> -EODUMP; - - $this->assertStringMatchesFormat($expectedDump, $dump); - } - - public function testClassStubWithNotExistingMethod() - { - $var = [new ClassStub('hello', [FooInterface::class, 'missing'])]; - - $cloner = new VarCloner(); - $dumper = new HtmlDumper(); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $dump = $dumper->dump($cloner->cloneVar($var), true, ['fileLinkFormat' => '%f:%l']); - - $expectedDump = <<<'EODUMP' -<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp> - <span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:5" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>" -</samp>] -</bar> -EODUMP; - - $this->assertStringMatchesFormat($expectedDump, $dump); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php deleted file mode 100644 index 1d7b3f62787a223d95c4f1ba803b3ad7fbd724ef..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php +++ /dev/null @@ -1,248 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Caster; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; - -/** - * @author Baptiste Clavié <clavie.b@gmail.com> - */ -class XmlReaderCasterTest extends TestCase -{ - use VarDumperTestTrait; - - /** @var \XmlReader */ - private $reader; - - protected function setUp() - { - $this->reader = new \XmlReader(); - $this->reader->open(__DIR__.'/../Fixtures/xml_reader.xml'); - } - - protected function tearDown() - { - $this->reader->close(); - } - - public function testParserProperty() - { - $this->reader->setParserProperty(\XMLReader::SUBST_ENTITIES, true); - - $expectedDump = <<<'EODUMP' -XMLReader { - +nodeType: NONE - parserProperties: { - SUBST_ENTITIES: true - …3 - } - …12 -} -EODUMP; - - $this->assertDumpMatchesFormat($expectedDump, $this->reader); - } - - /** - * @dataProvider provideNodes - */ - public function testNodes($seek, $expectedDump) - { - while ($seek--) { - $this->reader->read(); - } - $this->assertDumpMatchesFormat($expectedDump, $this->reader); - } - - public function provideNodes() - { - return [ - [0, <<<'EODUMP' -XMLReader { - +nodeType: NONE - …13 -} -EODUMP - ], - [1, <<<'EODUMP' -XMLReader { - +localName: "foo" - +nodeType: ELEMENT - +baseURI: "%sxml_reader.xml" - …11 -} -EODUMP - ], - [2, <<<'EODUMP' -XMLReader { - +localName: "#text" - +nodeType: SIGNIFICANT_WHITESPACE - +depth: 1 - +value: """ - \n - - """ - +baseURI: "%sxml_reader.xml" - …9 -} -EODUMP - ], - [3, <<<'EODUMP' -XMLReader { - +localName: "bar" - +nodeType: ELEMENT - +depth: 1 - +baseURI: "%sxml_reader.xml" - …10 -} -EODUMP - ], - [4, <<<'EODUMP' -XMLReader { - +localName: "bar" - +nodeType: END_ELEMENT - +depth: 1 - +baseURI: "%sxml_reader.xml" - …10 -} -EODUMP - ], - [6, <<<'EODUMP' -XMLReader { - +localName: "bar" - +nodeType: ELEMENT - +depth: 1 - +isEmptyElement: true - +baseURI: "%sxml_reader.xml" - …9 -} -EODUMP - ], - [9, <<<'EODUMP' -XMLReader { - +localName: "#text" - +nodeType: TEXT - +depth: 2 - +value: "With text" - +baseURI: "%sxml_reader.xml" - …9 -} -EODUMP - ], - [12, <<<'EODUMP' -XMLReader { - +localName: "bar" - +nodeType: ELEMENT - +depth: 1 - +attributeCount: 2 - +baseURI: "%sxml_reader.xml" - …9 -} -EODUMP - ], - [13, <<<'EODUMP' -XMLReader { - +localName: "bar" - +nodeType: END_ELEMENT - +depth: 1 - +baseURI: "%sxml_reader.xml" - …10 -} -EODUMP - ], - [15, <<<'EODUMP' -XMLReader { - +localName: "bar" - +nodeType: ELEMENT - +depth: 1 - +attributeCount: 1 - +baseURI: "%sxml_reader.xml" - …9 -} -EODUMP - ], - [16, <<<'EODUMP' -XMLReader { - +localName: "#text" - +nodeType: SIGNIFICANT_WHITESPACE - +depth: 2 - +value: """ - \n - - """ - +baseURI: "%sxml_reader.xml" - …9 -} -EODUMP - ], - [17, <<<'EODUMP' -XMLReader { - +localName: "baz" - +prefix: "baz" - +nodeType: ELEMENT - +depth: 2 - +namespaceURI: "http://symfony.com" - +baseURI: "%sxml_reader.xml" - …8 -} -EODUMP - ], - [18, <<<'EODUMP' -XMLReader { - +localName: "baz" - +prefix: "baz" - +nodeType: END_ELEMENT - +depth: 2 - +namespaceURI: "http://symfony.com" - +baseURI: "%sxml_reader.xml" - …8 -} -EODUMP - ], - [19, <<<'EODUMP' -XMLReader { - +localName: "#text" - +nodeType: SIGNIFICANT_WHITESPACE - +depth: 2 - +value: """ - \n - - """ - +baseURI: "%sxml_reader.xml" - …9 -} -EODUMP - ], - [21, <<<'EODUMP' -XMLReader { - +localName: "#text" - +nodeType: SIGNIFICANT_WHITESPACE - +depth: 1 - +value: "\n" - +baseURI: "%sxml_reader.xml" - …9 -} -EODUMP - ], - [22, <<<'EODUMP' -XMLReader { - +localName: "foo" - +nodeType: END_ELEMENT - +baseURI: "%sxml_reader.xml" - …11 -} -EODUMP - ], - ]; - } -} diff --git a/vendor/symfony/var-dumper/Tests/Cloner/DataTest.php b/vendor/symfony/var-dumper/Tests/Cloner/DataTest.php deleted file mode 100644 index d4b6c24c1163f5e6c2c82c172847b2807c67395e..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Cloner/DataTest.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Cloner; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Caster\ClassStub; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Cloner\VarCloner; - -class DataTest extends TestCase -{ - public function testBasicData() - { - $values = [1 => 123, 4.5, 'abc', null, false]; - $data = $this->cloneVar($values); - $clonedValues = []; - - $this->assertInstanceOf(Data::class, $data); - $this->assertCount(\count($values), $data); - $this->assertFalse(isset($data->{0})); - $this->assertFalse(isset($data[0])); - - foreach ($data as $k => $v) { - $this->assertTrue(isset($data->{$k})); - $this->assertTrue(isset($data[$k])); - $this->assertSame(\gettype($values[$k]), $data->seek($k)->getType()); - $this->assertSame($values[$k], $data->seek($k)->getValue()); - $this->assertSame($values[$k], $data->{$k}); - $this->assertSame($values[$k], $data[$k]); - $this->assertSame((string) $values[$k], (string) $data->seek($k)); - - $clonedValues[$k] = $v->getValue(); - } - - $this->assertSame($values, $clonedValues); - } - - public function testObject() - { - $data = $this->cloneVar(new \Exception('foo')); - - $this->assertSame('Exception', $data->getType()); - - $this->assertSame('foo', $data->message); - $this->assertSame('foo', $data->{Caster::PREFIX_PROTECTED.'message'}); - - $this->assertSame('foo', $data['message']); - $this->assertSame('foo', $data[Caster::PREFIX_PROTECTED.'message']); - - $this->assertStringMatchesFormat('Exception (count=%d)', (string) $data); - } - - public function testArray() - { - $values = [[], [123]]; - $data = $this->cloneVar($values); - - $this->assertSame($values, $data->getValue(true)); - - $children = $data->getValue(); - - $this->assertIsArray($children); - - $this->assertInstanceOf(Data::class, $children[0]); - $this->assertInstanceOf(Data::class, $children[1]); - - $this->assertEquals($children[0], $data[0]); - $this->assertEquals($children[1], $data[1]); - - $this->assertSame($values[0], $children[0]->getValue(true)); - $this->assertSame($values[1], $children[1]->getValue(true)); - } - - public function testStub() - { - $data = $this->cloneVar([new ClassStub('stdClass')]); - $data = $data[0]; - - $this->assertSame('string', $data->getType()); - $this->assertSame('stdClass', $data->getValue()); - $this->assertSame('stdClass', (string) $data); - } - - public function testHardRefs() - { - $values = [[]]; - $values[1] = &$values[0]; - $values[2][0] = &$values[2]; - - $data = $this->cloneVar($values); - - $this->assertSame([], $data[0]->getValue()); - $this->assertSame([], $data[1]->getValue()); - $this->assertEquals([$data[2]->getValue()], $data[2]->getValue(true)); - - $this->assertSame('array (count=3)', (string) $data); - } - - private function cloneVar($value) - { - $cloner = new VarCloner(); - - return $cloner->cloneVar($value); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php b/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php deleted file mode 100644 index e37482fca9c16608bcbe9f1bb8c345f364a853d0..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php +++ /dev/null @@ -1,505 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Cloner; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Tests\Fixtures\Php74; - -/** - * @author Nicolas Grekas <p@tchwork.com> - */ -class VarClonerTest extends TestCase -{ - public function testMaxIntBoundary() - { - $data = [\PHP_INT_MAX => 123]; - - $cloner = new VarCloner(); - $clone = $cloner->cloneVar($data); - - $expected = <<<EOTXT -Symfony\Component\VarDumper\Cloner\Data Object -( - [data:Symfony\Component\VarDumper\Cloner\Data:private] => Array - ( - [0] => Array - ( - [0] => Array - ( - [1] => 1 - ) - - ) - - [1] => Array - ( - [%s] => 123 - ) - - ) - - [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 - [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 - [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 -) - -EOTXT; - $this->assertSame(sprintf($expected, \PHP_INT_MAX), print_r($clone, true)); - } - - public function testClone() - { - $json = json_decode('{"1":{"var":"val"},"2":{"var":"val"}}'); - - $cloner = new VarCloner(); - $clone = $cloner->cloneVar($json); - - $expected = <<<EOTXT -Symfony\Component\VarDumper\Cloner\Data Object -( - [data:Symfony\Component\VarDumper\Cloner\Data:private] => Array - ( - [0] => Array - ( - [0] => Symfony\Component\VarDumper\Cloner\Stub Object - ( - [type] => 4 - [class] => stdClass - [value] => - [cut] => 0 - [handle] => %i - [refCount] => 0 - [position] => 1 - [attr] => Array - ( - ) - - ) - - ) - - [1] => Array - ( - [\000+\0001] => Symfony\Component\VarDumper\Cloner\Stub Object - ( - [type] => 4 - [class] => stdClass - [value] => - [cut] => 0 - [handle] => %i - [refCount] => 0 - [position] => 2 - [attr] => Array - ( - ) - - ) - - [\000+\0002] => Symfony\Component\VarDumper\Cloner\Stub Object - ( - [type] => 4 - [class] => stdClass - [value] => - [cut] => 0 - [handle] => %i - [refCount] => 0 - [position] => 3 - [attr] => Array - ( - ) - - ) - - ) - - [2] => Array - ( - [\000+\000var] => val - ) - - [3] => Array - ( - [\000+\000var] => val - ) - - ) - - [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 - [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 - [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 -) - -EOTXT; - $this->assertStringMatchesFormat($expected, print_r($clone, true)); - } - - public function testLimits() - { - // Level 0: - $data = [ - // Level 1: - [ - // Level 2: - [ - // Level 3: - 'Level 3 Item 0', - 'Level 3 Item 1', - 'Level 3 Item 2', - 'Level 3 Item 3', - ], - [ - 999 => 'Level 3 Item 4', - 'Level 3 Item 5', - 'Level 3 Item 6', - ], - [ - 'Level 3 Item 7', - ], - ], - [ - [ - 'Level 3 Item 8', - ], - 'Level 2 Item 0', - ], - [ - 'Level 2 Item 1', - ], - 'Level 1 Item 0', - [ - // Test setMaxString: - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'SHORT', - ], - ]; - - $cloner = new VarCloner(); - $cloner->setMinDepth(2); - $cloner->setMaxItems(5); - $cloner->setMaxString(20); - $clone = $cloner->cloneVar($data); - - $expected = <<<EOTXT -Symfony\Component\VarDumper\Cloner\Data Object -( - [data:Symfony\Component\VarDumper\Cloner\Data:private] => Array - ( - [0] => Array - ( - [0] => Array - ( - [2] => 1 - ) - - ) - - [1] => Array - ( - [0] => Array - ( - [2] => 2 - ) - - [1] => Array - ( - [2] => 3 - ) - - [2] => Array - ( - [2] => 4 - ) - - [3] => Level 1 Item 0 - [4] => Array - ( - [2] => 5 - ) - - ) - - [2] => Array - ( - [0] => Array - ( - [2] => 6 - ) - - [1] => Array - ( - [0] => 2 - [1] => 7 - ) - - [2] => Array - ( - [0] => 1 - [2] => 0 - ) - - ) - - [3] => Array - ( - [0] => Array - ( - [0] => 1 - [2] => 0 - ) - - [1] => Level 2 Item 0 - ) - - [4] => Array - ( - [0] => Level 2 Item 1 - ) - - [5] => Array - ( - [0] => Symfony\Component\VarDumper\Cloner\Stub Object - ( - [type] => 2 - [class] => 2 - [value] => ABCDEFGHIJKLMNOPQRST - [cut] => 6 - [handle] => 0 - [refCount] => 0 - [position] => 0 - [attr] => Array - ( - ) - - ) - - [1] => SHORT - ) - - [6] => Array - ( - [0] => Level 3 Item 0 - [1] => Level 3 Item 1 - [2] => Level 3 Item 2 - [3] => Level 3 Item 3 - ) - - [7] => Array - ( - [999] => Level 3 Item 4 - ) - - ) - - [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 - [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 - [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 -) - -EOTXT; - $this->assertStringMatchesFormat($expected, print_r($clone, true)); - } - - public function testJsonCast() - { - if (2 == ini_get('xdebug.overload_var_dump')) { - $this->markTestSkipped('xdebug is active'); - } - - $data = (array) json_decode('{"1":{}}'); - - $cloner = new VarCloner(); - $clone = $cloner->cloneVar($data); - - $expected = <<<'EOTXT' -object(Symfony\Component\VarDumper\Cloner\Data)#%i (6) { - ["data":"Symfony\Component\VarDumper\Cloner\Data":private]=> - array(2) { - [0]=> - array(1) { - [0]=> - array(1) { - [1]=> - int(1) - } - } - [1]=> - array(1) { - ["1"]=> - object(Symfony\Component\VarDumper\Cloner\Stub)#%i (8) { - ["type"]=> - int(4) - ["class"]=> - string(8) "stdClass" - ["value"]=> - NULL - ["cut"]=> - int(0) - ["handle"]=> - int(%i) - ["refCount"]=> - int(0) - ["position"]=> - int(0) - ["attr"]=> - array(0) { - } - } - } - } - ["position":"Symfony\Component\VarDumper\Cloner\Data":private]=> - int(0) - ["key":"Symfony\Component\VarDumper\Cloner\Data":private]=> - int(0) - ["maxDepth":"Symfony\Component\VarDumper\Cloner\Data":private]=> - int(20) - ["maxItemsPerDepth":"Symfony\Component\VarDumper\Cloner\Data":private]=> - int(-1) - ["useRefHandles":"Symfony\Component\VarDumper\Cloner\Data":private]=> - int(-1) -} - -EOTXT; - ob_start(); - var_dump($clone); - $this->assertStringMatchesFormat(\PHP_VERSION_ID >= 70200 ? str_replace('"1"', '1', $expected) : $expected, ob_get_clean()); - } - - public function testCaster() - { - $cloner = new VarCloner([ - '*' => function ($obj, $array) { - return ['foo' => 123]; - }, - __CLASS__ => function ($obj, $array) { - ++$array['foo']; - - return $array; - }, - ]); - $clone = $cloner->cloneVar($this); - - $expected = <<<EOTXT -Symfony\Component\VarDumper\Cloner\Data Object -( - [data:Symfony\Component\VarDumper\Cloner\Data:private] => Array - ( - [0] => Array - ( - [0] => Symfony\Component\VarDumper\Cloner\Stub Object - ( - [type] => 4 - [class] => %s - [value] => - [cut] => 0 - [handle] => %i - [refCount] => 0 - [position] => 1 - [attr] => Array - ( - ) - - ) - - ) - - [1] => Array - ( - [foo] => 124 - ) - - ) - - [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 - [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 - [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 -) - -EOTXT; - $this->assertStringMatchesFormat($expected, print_r($clone, true)); - } - - /** - * @requires PHP 7.4 - */ - public function testPhp74() - { - $data = new Php74(); - - $cloner = new VarCloner(); - $clone = $cloner->cloneVar($data); - - $expected = <<<'EOTXT' -Symfony\Component\VarDumper\Cloner\Data Object -( - [data:Symfony\Component\VarDumper\Cloner\Data:private] => Array - ( - [0] => Array - ( - [0] => Symfony\Component\VarDumper\Cloner\Stub Object - ( - [type] => 4 - [class] => Symfony\Component\VarDumper\Tests\Fixtures\Php74 - [value] => - [cut] => 0 - [handle] => %i - [refCount] => 0 - [position] => 1 - [attr] => Array - ( - ) - - ) - - ) - - [1] => Array - ( - [p1] => 123 - [p2] => Symfony\Component\VarDumper\Cloner\Stub Object - ( - [type] => 4 - [class] => stdClass - [value] => - [cut] => 0 - [handle] => %i - [refCount] => 0 - [position] => 0 - [attr] => Array - ( - ) - - ) - - ) - - ) - - [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 - [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 - [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 - [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 -) - -EOTXT; - $this->assertStringMatchesFormat($expected, print_r($clone, true)); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php b/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php deleted file mode 100644 index 6fae0843a9d0e28f1351704d88038b2d27b920ac..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php +++ /dev/null @@ -1,644 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Dumper; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\AbstractDumper; -use Symfony\Component\VarDumper\Dumper\CliDumper; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; -use Twig\Environment; -use Twig\Loader\FilesystemLoader; - -/** - * @author Nicolas Grekas <p@tchwork.com> - */ -class CliDumperTest extends TestCase -{ - use VarDumperTestTrait; - - public function testGet() - { - require __DIR__.'/../Fixtures/dumb-var.php'; - - $dumper = new CliDumper('php://output'); - $dumper->setColors(false); - $cloner = new VarCloner(); - $cloner->addCasters([ - ':stream' => function ($res, $a) { - unset($a['uri'], $a['wrapper_data']); - - return $a; - }, - ]); - $data = $cloner->cloneVar($var); - - ob_start(); - $dumper->dump($data); - $out = ob_get_clean(); - $out = preg_replace('/[ \t]+$/m', '', $out); - $intMax = \PHP_INT_MAX; - $res = (int) $var['res']; - - $r = \defined('HHVM_VERSION') ? '' : '#%d'; - $this->assertStringMatchesFormat( - <<<EOTXT -array:24 [ - "number" => 1 - 0 => &1 null - "const" => 1.1 - 1 => true - 2 => false - 3 => NAN - 4 => INF - 5 => -INF - 6 => {$intMax} - "str" => "déjà\\n" - 7 => b"é\\x00" - "[]" => [] - "res" => stream resource {@{$res} -%A wrapper_type: "plainfile" - stream_type: "STDIO" - mode: "r" - unread_bytes: 0 - seekable: true -%A options: [] - } - "obj" => Symfony\Component\VarDumper\Tests\Fixture\DumbFoo {#%d - +foo: "foo" - +"bar": "bar" - } - "closure" => Closure {{$r} - class: "Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest" - this: Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest {{$r} …} - parameters: { - \$a: {} - &\$b: { - typeHint: "PDO" - default: null - } - } - file: "%s%eTests%eFixtures%edumb-var.php" - line: "{$var['line']} to {$var['line']}" - } - "line" => {$var['line']} - "nobj" => array:1 [ - 0 => &3 {#%d} - ] - "recurs" => &4 array:1 [ - 0 => &4 array:1 [&4] - ] - 8 => &1 null - "sobj" => Symfony\Component\VarDumper\Tests\Fixture\DumbFoo {#%d} - "snobj" => &3 {#%d} - "snobj2" => {#%d} - "file" => "{$var['file']}" - b"bin-key-é" => "" -] - -EOTXT - , - $out - ); - } - - /** - * @dataProvider provideDumpWithCommaFlagTests - */ - public function testDumpWithCommaFlag($expected, $flags) - { - $dumper = new CliDumper(null, null, $flags); - $dumper->setColors(false); - $cloner = new VarCloner(); - - $var = [ - 'array' => ['a', 'b'], - 'string' => 'hello', - 'multiline string' => "this\nis\na\multiline\nstring", - ]; - - $dump = $dumper->dump($cloner->cloneVar($var), true); - - $this->assertSame($expected, $dump); - } - - public function testDumpWithCommaFlagsAndExceptionCodeExcerpt() - { - $dumper = new CliDumper(null, null, CliDumper::DUMP_TRAILING_COMMA); - $dumper->setColors(false); - $cloner = new VarCloner(); - - $ex = new \RuntimeException('foo'); - - $dump = $dumper->dump($cloner->cloneVar($ex)->withRefHandles(false), true); - - $this->assertStringMatchesFormat(<<<'EOTXT' -RuntimeException { - #message: "foo" - #code: 0 - #file: "%ACliDumperTest.php" - #line: %d - trace: { - %ACliDumperTest.php:%d { - › - › $ex = new \RuntimeException('foo'); - › - } - %A - } -} - -EOTXT - , $dump); - } - - public function provideDumpWithCommaFlagTests() - { - $expected = <<<'EOTXT' -array:3 [ - "array" => array:2 [ - 0 => "a", - 1 => "b" - ], - "string" => "hello", - "multiline string" => """ - this\n - is\n - a\multiline\n - string - """ -] - -EOTXT; - - yield [$expected, CliDumper::DUMP_COMMA_SEPARATOR]; - - $expected = <<<'EOTXT' -array:3 [ - "array" => array:2 [ - 0 => "a", - 1 => "b", - ], - "string" => "hello", - "multiline string" => """ - this\n - is\n - a\multiline\n - string - """, -] - -EOTXT; - - yield [$expected, CliDumper::DUMP_TRAILING_COMMA]; - } - - /** - * @requires extension xml - * @requires PHP < 8.0 - */ - public function testXmlResource() - { - $var = xml_parser_create(); - - $this->assertDumpMatchesFormat( - <<<'EOTXT' -xml resource { - current_byte_index: %i - current_column_number: %i - current_line_number: 1 - error_code: XML_ERROR_NONE -} -EOTXT - , - $var - ); - } - - public function testJsonCast() - { - $var = (array) json_decode('{"0":{},"1":null}'); - foreach ($var as &$v) { - } - $var[] = &$v; - $var[''] = 2; - - if (\PHP_VERSION_ID >= 70200) { - $this->assertDumpMatchesFormat( - <<<'EOTXT' -array:4 [ - 0 => {} - 1 => &1 null - 2 => &1 null - "" => 2 -] -EOTXT - , - $var - ); - } else { - $this->assertDumpMatchesFormat( - <<<'EOTXT' -array:4 [ - "0" => {} - "1" => &1 null - 0 => &1 null - "" => 2 -] -EOTXT - , - $var - ); - } - } - - public function testObjectCast() - { - $var = (object) [1 => 1]; - $var->{1} = 2; - - if (\PHP_VERSION_ID >= 70200) { - $this->assertDumpMatchesFormat( - <<<'EOTXT' -{ - +"1": 2 -} -EOTXT - , - $var - ); - } else { - $this->assertDumpMatchesFormat( - <<<'EOTXT' -{ - +1: 1 - +"1": 2 -} -EOTXT - , - $var - ); - } - } - - public function testClosedResource() - { - if (\defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) { - $this->markTestSkipped(); - } - - $var = fopen(__FILE__, 'r'); - fclose($var); - - $dumper = new CliDumper('php://output'); - $dumper->setColors(false); - $cloner = new VarCloner(); - $data = $cloner->cloneVar($var); - - ob_start(); - $dumper->dump($data); - $out = ob_get_clean(); - $res = (int) $var; - - $this->assertStringMatchesFormat( - <<<EOTXT -Closed resource @{$res} - -EOTXT - , - $out - ); - } - - public function testFlags() - { - putenv('DUMP_LIGHT_ARRAY=1'); - putenv('DUMP_STRING_LENGTH=1'); - - $var = [ - range(1, 3), - ['foo', 2 => 'bar'], - ]; - - $this->assertDumpEquals( - <<<EOTXT -[ - [ - 1 - 2 - 3 - ] - [ - 0 => (3) "foo" - 2 => (3) "bar" - ] -] -EOTXT - , - $var - ); - - putenv('DUMP_LIGHT_ARRAY='); - putenv('DUMP_STRING_LENGTH='); - } - - /** - * @requires function Twig\Template::getSourceContext - */ - public function testThrowingCaster() - { - $out = fopen('php://memory', 'r+b'); - - require_once __DIR__.'/../Fixtures/Twig.php'; - $twig = new \__TwigTemplate_VarDumperFixture_u75a09(new Environment(new FilesystemLoader())); - - $dumper = new CliDumper(); - $dumper->setColors(false); - $cloner = new VarCloner(); - $cloner->addCasters([ - ':stream' => function ($res, $a) { - unset($a['wrapper_data']); - - return $a; - }, - ]); - $cloner->addCasters([ - ':stream' => eval('return function () use ($twig) { - try { - $twig->render([]); - } catch (\Twig\Error\RuntimeError $e) { - throw $e->getPrevious(); - } - };'), - ]); - $ref = (int) $out; - - $data = $cloner->cloneVar($out); - $dumper->dump($data, $out); - $out = stream_get_contents($out, -1, 0); - - $r = \defined('HHVM_VERSION') ? '' : '#%d'; - $this->assertStringMatchesFormat( - <<<EOTXT -stream resource {@{$ref} - ⚠: Symfony\Component\VarDumper\Exception\ThrowingCasterException {{$r} - #message: "Unexpected Exception thrown from a caster: Foobar" - trace: { - %sTwig.php:2 { - › foo bar - › twig source - › - } - %s%eTemplate.php:%d { …} - %s%eTemplate.php:%d { …} - %s%eTemplate.php:%d { …} - %s%eTests%eDumper%eCliDumperTest.php:%d { …} -%A } - } -%Awrapper_type: "PHP" - stream_type: "MEMORY" - mode: "%s+b" - unread_bytes: 0 - seekable: true - uri: "php://memory" -%Aoptions: [] -} - -EOTXT - , - $out - ); - } - - public function testRefsInProperties() - { - $var = (object) ['foo' => 'foo']; - $var->bar = &$var->foo; - - $dumper = new CliDumper(); - $dumper->setColors(false); - $cloner = new VarCloner(); - - $data = $cloner->cloneVar($var); - $out = $dumper->dump($data, true); - - $r = \defined('HHVM_VERSION') ? '' : '#%d'; - $this->assertStringMatchesFormat( - <<<EOTXT -{{$r} - +"foo": &1 "foo" - +"bar": &1 "foo" -} - -EOTXT - , - $out - ); - } - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - * @requires PHP 5.6 - */ - public function testSpecialVars56() - { - $var = $this->getSpecialVars(); - - $this->assertDumpEquals( - <<<'EOTXT' -array:3 [ - 0 => array:1 [ - 0 => &1 array:1 [ - 0 => &1 array:1 [&1] - ] - ] - 1 => array:1 [ - "GLOBALS" => &2 array:1 [ - "GLOBALS" => &2 array:1 [&2] - ] - ] - 2 => &2 array:1 [&2] -] -EOTXT - , - $var - ); - } - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testGlobalsNoExt() - { - $var = $this->getSpecialVars(); - unset($var[0]); - $out = ''; - - $dumper = new CliDumper(function ($line, $depth) use (&$out) { - if ($depth >= 0) { - $out .= str_repeat(' ', $depth).$line."\n"; - } - }); - $dumper->setColors(false); - $cloner = new VarCloner(); - - $refl = new \ReflectionProperty($cloner, 'useExt'); - $refl->setAccessible(true); - $refl->setValue($cloner, false); - - $data = $cloner->cloneVar($var); - $dumper->dump($data); - - $this->assertSame( - <<<'EOTXT' -array:2 [ - 1 => array:1 [ - "GLOBALS" => &1 array:1 [ - "GLOBALS" => &1 array:1 [&1] - ] - ] - 2 => &1 array:1 [&1] -] - -EOTXT - , - $out - ); - } - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testBuggyRefs() - { - if (\PHP_VERSION_ID >= 50600) { - $this->markTestSkipped('PHP 5.6 fixed refs counting'); - } - - $var = $this->getSpecialVars(); - $var = $var[0]; - - $dumper = new CliDumper(); - $dumper->setColors(false); - $cloner = new VarCloner(); - - $data = $cloner->cloneVar($var)->withMaxDepth(3); - $out = ''; - $dumper->dump($data, function ($line, $depth) use (&$out) { - if ($depth >= 0) { - $out .= str_repeat(' ', $depth).$line."\n"; - } - }); - - $this->assertSame( - <<<'EOTXT' -array:1 [ - 0 => array:1 [ - 0 => array:1 [ - 0 => array:1 [ …1] - ] - ] -] - -EOTXT - , - $out - ); - } - - public function testIncompleteClass() - { - $unserializeCallbackHandler = ini_set('unserialize_callback_func', null); - $var = unserialize('O:8:"Foo\Buzz":0:{}'); - ini_set('unserialize_callback_func', $unserializeCallbackHandler); - - $this->assertDumpMatchesFormat( - <<<EOTXT -__PHP_Incomplete_Class(Foo\Buzz) {} -EOTXT - , - $var - ); - } - - public function provideDumpArrayWithColor() - { - yield [ - ['foo' => 'bar'], - 0, - <<<EOTXT -\e[0;38;5;208m\e[38;5;38marray:1\e[0;38;5;208m [\e[m - \e[0;38;5;208m"\e[38;5;113mfoo\e[0;38;5;208m" => "\e[1;38;5;113mbar\e[0;38;5;208m"\e[m -\e[0;38;5;208m]\e[m - -EOTXT - ]; - - yield [[], AbstractDumper::DUMP_LIGHT_ARRAY, "\e[0;38;5;208m[]\e[m\n"]; - - yield [ - ['foo' => 'bar'], - AbstractDumper::DUMP_LIGHT_ARRAY, - <<<EOTXT -\e[0;38;5;208m[\e[m - \e[0;38;5;208m"\e[38;5;113mfoo\e[0;38;5;208m" => "\e[1;38;5;113mbar\e[0;38;5;208m"\e[m -\e[0;38;5;208m]\e[m - -EOTXT - ]; - - yield [[], 0, "\e[0;38;5;208m[]\e[m\n"]; - } - - /** - * @dataProvider provideDumpArrayWithColor - */ - public function testDumpArrayWithColor($value, $flags, $expectedOut) - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $this->markTestSkipped('Windows console does not support coloration'); - } - - $out = ''; - $dumper = new CliDumper(function ($line, $depth) use (&$out) { - if ($depth >= 0) { - $out .= str_repeat(' ', $depth).$line."\n"; - } - }, null, $flags); - $dumper->setColors(true); - $cloner = new VarCloner(); - $dumper->dump($cloner->cloneVar($value)); - - $this->assertSame($expectedOut, $out); - } - - private function getSpecialVars() - { - foreach (array_keys($GLOBALS) as $var) { - if ('GLOBALS' !== $var) { - unset($GLOBALS[$var]); - } - } - - $var = function &() { - $var = []; - $var[] = &$var; - - return $var; - }; - - return [$var(), $GLOBALS, &$GLOBALS]; - } -} diff --git a/vendor/symfony/var-dumper/Tests/Dumper/FunctionsTest.php b/vendor/symfony/var-dumper/Tests/Dumper/FunctionsTest.php deleted file mode 100644 index 7444d4bf58425ad4218cde0c38945710d0fd970b..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Dumper/FunctionsTest.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Dumper; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; -use Symfony\Component\VarDumper\VarDumper; - -class FunctionsTest extends TestCase -{ - public function testDumpReturnsFirstArg() - { - $this->setupVarDumper(); - - $var1 = 'a'; - - ob_start(); - $return = dump($var1); - ob_end_clean(); - - $this->assertEquals($var1, $return); - } - - public function testDumpReturnsAllArgsInArray() - { - $this->setupVarDumper(); - - $var1 = 'a'; - $var2 = 'b'; - $var3 = 'c'; - - ob_start(); - $return = dump($var1, $var2, $var3); - ob_end_clean(); - - $this->assertEquals([$var1, $var2, $var3], $return); - } - - protected function setupVarDumper() - { - $cloner = new VarCloner(); - $dumper = new CliDumper('php://output'); - VarDumper::setHandler(function ($var) use ($cloner, $dumper) { - $dumper->dump($cloner->cloneVar($var)); - }); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Dumper/HtmlDumperTest.php b/vendor/symfony/var-dumper/Tests/Dumper/HtmlDumperTest.php deleted file mode 100644 index d91fda265bc262503db25b65b27235d8f4d9e27a..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Dumper/HtmlDumperTest.php +++ /dev/null @@ -1,168 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Dumper; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; - -/** - * @author Nicolas Grekas <p@tchwork.com> - */ -class HtmlDumperTest extends TestCase -{ - public function testGet() - { - if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) { - $this->markTestSkipped('A custom file_link_format is defined.'); - } - - require __DIR__.'/../Fixtures/dumb-var.php'; - - $dumper = new HtmlDumper('php://output'); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $cloner = new VarCloner(); - $cloner->addCasters([ - ':stream' => function ($res, $a) { - unset($a['uri'], $a['wrapper_data']); - - return $a; - }, - ]); - $data = $cloner->cloneVar($var); - - ob_start(); - $dumper->dump($data); - $out = ob_get_clean(); - $out = preg_replace('/[ \t]+$/m', '', $out); - $var['file'] = htmlspecialchars($var['file'], \ENT_QUOTES, 'UTF-8'); - $intMax = \PHP_INT_MAX; - preg_match('/sf-dump-\d+/', $out, $dumpId); - $dumpId = $dumpId[0]; - $res = (int) $var['res']; - - $r = \defined('HHVM_VERSION') ? '' : '<a class=sf-dump-ref>#%d</a>'; - $this->assertStringMatchesFormat( - <<<EOTXT -<foo></foo><bar><span class=sf-dump-note>array:24</span> [<samp> - "<span class=sf-dump-key>number</span>" => <span class=sf-dump-num>1</span> - <span class=sf-dump-key>0</span> => <a class=sf-dump-ref href=#{$dumpId}-ref01 title="2 occurrences">&1</a> <span class=sf-dump-const>null</span> - "<span class=sf-dump-key>const</span>" => <span class=sf-dump-num>1.1</span> - <span class=sf-dump-key>1</span> => <span class=sf-dump-const>true</span> - <span class=sf-dump-key>2</span> => <span class=sf-dump-const>false</span> - <span class=sf-dump-key>3</span> => <span class=sf-dump-num>NAN</span> - <span class=sf-dump-key>4</span> => <span class=sf-dump-num>INF</span> - <span class=sf-dump-key>5</span> => <span class=sf-dump-num>-INF</span> - <span class=sf-dump-key>6</span> => <span class=sf-dump-num>{$intMax}</span> - "<span class=sf-dump-key>str</span>" => "<span class=sf-dump-str title="5 characters">d&%s;j&%s;<span class=sf-dump-default>\\n</span></span>" - <span class=sf-dump-key>7</span> => b"<span class=sf-dump-str title="2 binary or non-UTF-8 characters">&%s;<span class=sf-dump-default>\\x00</span></span>" - "<span class=sf-dump-key>[]</span>" => [] - "<span class=sf-dump-key>res</span>" => <span class=sf-dump-note>stream resource</span> <a class=sf-dump-ref>@{$res}</a><samp> -%A <span class=sf-dump-meta>wrapper_type</span>: "<span class=sf-dump-str title="9 characters">plainfile</span>" - <span class=sf-dump-meta>stream_type</span>: "<span class=sf-dump-str title="5 characters">STDIO</span>" - <span class=sf-dump-meta>mode</span>: "<span class=sf-dump-str>r</span>" - <span class=sf-dump-meta>unread_bytes</span>: <span class=sf-dump-num>0</span> - <span class=sf-dump-meta>seekable</span>: <span class=sf-dump-const>true</span> -%A <span class=sf-dump-meta>options</span>: [] - </samp>} - "<span class=sf-dump-key>obj</span>" => <abbr title="Symfony\Component\VarDumper\Tests\Fixture\DumbFoo" class=sf-dump-note>DumbFoo</abbr> {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="2 occurrences">#%d</a><samp id={$dumpId}-ref2%d> - +<span class=sf-dump-public title="Public property">foo</span>: "<span class=sf-dump-str title="3 characters">foo</span>" - +"<span class=sf-dump-public title="Runtime added dynamic property">bar</span>": "<span class=sf-dump-str title="3 characters">bar</span>" - </samp>} - "<span class=sf-dump-key>closure</span>" => <span class=sf-dump-note>Closure</span> {{$r}<samp> - <span class=sf-dump-meta>class</span>: "<span class=sf-dump-str title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest -55 characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-class">Symfony\Component\VarDumper\Tests\Dumper</span><span class=sf-dump-ellipsis>\</span>HtmlDumperTest</span>" - <span class=sf-dump-meta>this</span>: <abbr title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest" class=sf-dump-note>HtmlDumperTest</abbr> {{$r} &%s;} - <span class=sf-dump-meta>parameters</span>: {<samp> - <span class=sf-dump-meta>\$a</span>: {} - <span class=sf-dump-meta>&\$b</span>: {<samp> - <span class=sf-dump-meta>typeHint</span>: "<span class=sf-dump-str title="3 characters">PDO</span>" - <span class=sf-dump-meta>default</span>: <span class=sf-dump-const>null</span> - </samp>} - </samp>} - <span class=sf-dump-meta>file</span>: "<span class=sf-dump-str title="{$var['file']} -%d characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eFixtures%edumb-var.php</span>" - <span class=sf-dump-meta>line</span>: "<span class=sf-dump-str title="%d characters">{$var['line']} to {$var['line']}</span>" - </samp>} - "<span class=sf-dump-key>line</span>" => <span class=sf-dump-num>{$var['line']}</span> - "<span class=sf-dump-key>nobj</span>" => <span class=sf-dump-note>array:1</span> [<samp> - <span class=sf-dump-index>0</span> => <a class=sf-dump-ref href=#{$dumpId}-ref03 title="2 occurrences">&3</a> {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="3 occurrences">#%d</a>} - </samp>] - "<span class=sf-dump-key>recurs</span>" => <a class=sf-dump-ref href=#{$dumpId}-ref04 title="2 occurrences">&4</a> <span class=sf-dump-note>array:1</span> [<samp id={$dumpId}-ref04> - <span class=sf-dump-index>0</span> => <a class=sf-dump-ref href=#{$dumpId}-ref04 title="2 occurrences">&4</a> <span class=sf-dump-note>array:1</span> [<a class=sf-dump-ref href=#{$dumpId}-ref04 title="2 occurrences">&4</a>] - </samp>] - <span class=sf-dump-key>8</span> => <a class=sf-dump-ref href=#{$dumpId}-ref01 title="2 occurrences">&1</a> <span class=sf-dump-const>null</span> - "<span class=sf-dump-key>sobj</span>" => <abbr title="Symfony\Component\VarDumper\Tests\Fixture\DumbFoo" class=sf-dump-note>DumbFoo</abbr> {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="2 occurrences">#%d</a>} - "<span class=sf-dump-key>snobj</span>" => <a class=sf-dump-ref href=#{$dumpId}-ref03 title="2 occurrences">&3</a> {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="3 occurrences">#%d</a>} - "<span class=sf-dump-key>snobj2</span>" => {<a class=sf-dump-ref href=#{$dumpId}-ref2%d title="3 occurrences">#%d</a>} - "<span class=sf-dump-key>file</span>" => "<span class=sf-dump-str title="%d characters">{$var['file']}</span>" - b"<span class=sf-dump-key>bin-key-&%s;</span>" => "" -</samp>] -</bar> - -EOTXT - , - - $out - ); - } - - public function testCharset() - { - $var = mb_convert_encoding('Словарь', 'CP1251', 'UTF-8'); - - $dumper = new HtmlDumper('php://output', 'CP1251'); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $cloner = new VarCloner(); - - $data = $cloner->cloneVar($var); - $out = $dumper->dump($data, true); - - $this->assertStringMatchesFormat( - <<<'EOTXT' -<foo></foo><bar>b"<span class=sf-dump-str title="7 binary or non-UTF-8 characters">Словарь</span>" -</bar> - -EOTXT - , - $out - ); - } - - public function testAppend() - { - $out = fopen('php://memory', 'r+b'); - - $dumper = new HtmlDumper(); - $dumper->setDumpHeader('<foo></foo>'); - $dumper->setDumpBoundaries('<bar>', '</bar>'); - $cloner = new VarCloner(); - - $dumper->dump($cloner->cloneVar(123), $out); - $dumper->dump($cloner->cloneVar(456), $out); - - $out = stream_get_contents($out, -1, 0); - - $this->assertSame(<<<'EOTXT' -<foo></foo><bar><span class=sf-dump-num>123</span> -</bar> -<bar><span class=sf-dump-num>456</span> -</bar> - -EOTXT - , - $out - ); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Fixtures/DateTimeChild.php b/vendor/symfony/var-dumper/Tests/Fixtures/DateTimeChild.php deleted file mode 100644 index 2ea2df6514ae0472dd2cff40a26963210372fd2c..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Fixtures/DateTimeChild.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -namespace Symfony\Component\VarDumper\Tests\Fixtures; - -class DateTimeChild extends \DateTime -{ - private $addedProperty = 'foo'; -} diff --git a/vendor/symfony/var-dumper/Tests/Fixtures/FooInterface.php b/vendor/symfony/var-dumper/Tests/Fixtures/FooInterface.php deleted file mode 100644 index 874110a5b64f8968bc115eb6a9a912ec91d45161..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Fixtures/FooInterface.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -namespace Symfony\Component\VarDumper\Tests\Fixtures; - -interface FooInterface -{ - /** - * Hello. - */ - public function foo(); -} diff --git a/vendor/symfony/var-dumper/Tests/Fixtures/GeneratorDemo.php b/vendor/symfony/var-dumper/Tests/Fixtures/GeneratorDemo.php deleted file mode 100644 index e2d24c8c0eac68458dbdeb4cef7e6149de86c9a0..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Fixtures/GeneratorDemo.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Symfony\Component\VarDumper\Tests\Fixtures; - -class GeneratorDemo -{ - public static function foo() - { - yield 1; - } - - public function baz() - { - yield from bar(); - } -} - -function bar() -{ - yield from GeneratorDemo::foo(); -} diff --git a/vendor/symfony/var-dumper/Tests/Fixtures/NotLoadableClass.php b/vendor/symfony/var-dumper/Tests/Fixtures/NotLoadableClass.php deleted file mode 100644 index d8e0cb359f4fd571ca340f86f52d8022a432a2a6..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Fixtures/NotLoadableClass.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -namespace Symfony\Component\VarDumper\Tests\Fixtures; - -class NotLoadableClass extends NotLoadableClass -{ -} diff --git a/vendor/symfony/var-dumper/Tests/Fixtures/Php74.php b/vendor/symfony/var-dumper/Tests/Fixtures/Php74.php deleted file mode 100644 index 724fbeb7bdb6e33db47f30e721e303cebfbe6840..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Fixtures/Php74.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Symfony\Component\VarDumper\Tests\Fixtures; - -class Php74 -{ - public $p1 = 123; - public \stdClass $p2; - - public function __construct() - { - $this->p2 = new \stdClass(); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Fixtures/Twig.php b/vendor/symfony/var-dumper/Tests/Fixtures/Twig.php deleted file mode 100644 index 8b84d820fcf7c50b56c0111f02eb3cc2ca3bc07e..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Fixtures/Twig.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* foo.twig */ -class __TwigTemplate_VarDumperFixture_u75a09 extends Twig\Template -{ - private $path; - - public function __construct(Twig\Environment $env = null, $path = null) - { - if (null !== $env) { - parent::__construct($env); - } - $this->parent = false; - $this->blocks = []; - $this->path = $path; - } - - protected function doDisplay(array $context, array $blocks = []) - { - // line 2 - throw new \Exception('Foobar'); - } - - public function getTemplateName() - { - return 'foo.twig'; - } - - public function getDebugInfo() - { - return [20 => 1, 21 => 2]; - } - - public function getSourceContext() - { - return new Twig\Source(" foo bar\n twig source\n\n", 'foo.twig', $this->path ?: __FILE__); - } -} diff --git a/vendor/symfony/var-dumper/Tests/Fixtures/dumb-var.php b/vendor/symfony/var-dumper/Tests/Fixtures/dumb-var.php deleted file mode 100644 index de51cebc219cedcc56629e49ca61f894195edf78..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Fixtures/dumb-var.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Symfony\Component\VarDumper\Tests\Fixture; - -if (!class_exists('Symfony\Component\VarDumper\Tests\Fixture\DumbFoo')) { - class DumbFoo - { - public $foo = 'foo'; - } -} - -$foo = new DumbFoo(); -$foo->bar = 'bar'; - -$g = fopen(__FILE__, 'r'); - -$var = [ - 'number' => 1, null, - 'const' => 1.1, true, false, NAN, INF, -INF, PHP_INT_MAX, - 'str' => "déjà\n", "\xE9\x00", - '[]' => [], - 'res' => $g, - 'obj' => $foo, - 'closure' => function ($a, \PDO &$b = null) {}, - 'line' => __LINE__ - 1, - 'nobj' => [(object) []], -]; - -$r = []; -$r[] = &$r; - -$var['recurs'] = &$r; -$var[] = &$var[0]; -$var['sobj'] = $var['obj']; -$var['snobj'] = &$var['nobj'][0]; -$var['snobj2'] = $var['nobj'][0]; -$var['file'] = __FILE__; -$var["bin-key-\xE9"] = ''; - -unset($g, $r); diff --git a/vendor/symfony/var-dumper/Tests/Fixtures/xml_reader.xml b/vendor/symfony/var-dumper/Tests/Fixtures/xml_reader.xml deleted file mode 100644 index 740c399fc44376b513182a17affd9ae8ac06bffc..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Fixtures/xml_reader.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<foo> - <bar></bar> - <bar /> - <bar>With text</bar> - <bar foo="bar" baz="fubar"></bar> - <bar xmlns:baz="http://symfony.com"> - <baz:baz></baz:baz> - </bar> -</foo> diff --git a/vendor/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php b/vendor/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php deleted file mode 100644 index 18042fb3bf5945216bd1705cfeab7390c2293bdf..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Tests\Test; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\VarDumper\Test\VarDumperTestTrait; - -class VarDumperTestTraitTest extends TestCase -{ - use VarDumperTestTrait; - - public function testItComparesLargeData() - { - $howMany = 700; - $data = array_fill_keys(range(0, $howMany), ['a', 'b', 'c', 'd']); - - $expected = sprintf("array:%d [\n", $howMany + 1); - for ($i = 0; $i <= $howMany; ++$i) { - $expected .= <<<EODUMP - $i => array:4 [ - 0 => "a" - 1 => "b" - 2 => "c" - 3 => "d" - ]\n -EODUMP; - } - $expected .= "]\n"; - - $this->assertDumpEquals($expected, $data); - } -} diff --git a/vendor/symfony/var-dumper/VarDumper.php b/vendor/symfony/var-dumper/VarDumper.php index 2ef20c064b01559dbea456cbec3cc8e917715729..febc1e0d17bc474976d13cc33c96227b4620f415 100644 --- a/vendor/symfony/var-dumper/VarDumper.php +++ b/vendor/symfony/var-dumper/VarDumper.php @@ -11,8 +11,11 @@ namespace Symfony\Component\VarDumper; +use Symfony\Component\VarDumper\Caster\ReflectionCaster; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\CliDumper; +use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; +use Symfony\Component\VarDumper\Dumper\ContextualizedDumper; use Symfony\Component\VarDumper\Dumper\HtmlDumper; // Load the global dump() function @@ -29,18 +32,33 @@ public static function dump($var) { if (null === self::$handler) { $cloner = new VarCloner(); - $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); + $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); + + if (isset($_SERVER['VAR_DUMPER_FORMAT'])) { + $dumper = 'html' === $_SERVER['VAR_DUMPER_FORMAT'] ? new HtmlDumper() : new CliDumper(); + } else { + $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper() : new HtmlDumper(); + } + + $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]); + self::$handler = function ($var) use ($cloner, $dumper) { $dumper->dump($cloner->cloneVar($var)); }; } - return \call_user_func(self::$handler, $var); + return (self::$handler)($var); } public static function setHandler(callable $callable = null) { $prevHandler = self::$handler; + + // Prevent replacing the handler with expected format as soon as the env var was set: + if (isset($_SERVER['VAR_DUMPER_FORMAT'])) { + return $prevHandler; + } + self::$handler = $callable; return $prevHandler; diff --git a/vendor/symfony/var-dumper/composer.json b/vendor/symfony/var-dumper/composer.json index 9f2352ee2569c0f21edb5b1ff9cef38dab92ba8a..642ee62b0df62046b56e68914d9403f18accdf26 100644 --- a/vendor/symfony/var-dumper/composer.json +++ b/vendor/symfony/var-dumper/composer.json @@ -1,7 +1,7 @@ { "name": "symfony/var-dumper", "type": "library", - "description": "Symfony mechanism for exploring and dumping PHP variables", + "description": "Provides mechanisms for walking through any arbitrary PHP variable", "keywords": ["dump", "debug"], "homepage": "https://symfony.com", "license": "MIT", @@ -16,20 +16,25 @@ } ], "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", + "symfony/polyfill-php80": "^1.15" }, "require-dev": { "ext-iconv": "*", - "twig/twig": "~1.34|~2.4" + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.43|^2.13|^3.0.4" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", "ext-intl": "To show region name in time zone dump", - "ext-symfony_debug": "" + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, "autoload": { "files": [ "Resources/functions/dump.php" ], @@ -38,5 +43,8 @@ "/Tests/" ] }, + "bin": [ + "Resources/bin/var-dump-server" + ], "minimum-stability": "dev" } diff --git a/vendor/symfony/var-dumper/phpunit.xml.dist b/vendor/symfony/var-dumper/phpunit.xml.dist deleted file mode 100644 index 3243fcd0279ccf5ab05e3fc8e0b6c84fbba0c669..0000000000000000000000000000000000000000 --- a/vendor/symfony/var-dumper/phpunit.xml.dist +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd" - backupGlobals="false" - colors="true" - bootstrap="vendor/autoload.php" - failOnRisky="true" - failOnWarning="true" -> - <php> - <ini name="error_reporting" value="-1" /> - <env name="DUMP_LIGHT_ARRAY" value="" /> - <env name="DUMP_STRING_LENGTH" value="" /> - </php> - - <testsuites> - <testsuite name="Symfony VarDumper Component Test Suite"> - <directory>./Tests/</directory> - </testsuite> - </testsuites> - - <filter> - <whitelist> - <directory>./</directory> - <exclude> - <directory>./Resources</directory> - <directory>./Tests</directory> - <directory>./vendor</directory> - </exclude> - </whitelist> - </filter> -</phpunit> diff --git a/web/modules/config_direct_save/config_direct_save.info.yml b/web/modules/config_direct_save/config_direct_save.info.yml index a8d0a300f25a1bcf1d1c9578166086c2435e8b0b..29f148a0d611e876e61f7a8749ff06effb325c2b 100644 --- a/web/modules/config_direct_save/config_direct_save.info.yml +++ b/web/modules/config_direct_save/config_direct_save.info.yml @@ -1,11 +1,11 @@ name: Config Direct Save -# core: 8.x +core: 8.x +core_version_requirement: ^8 || ^9 description: This module allow you to export configuration after changes type: module package: Deployment -# Information added by Drupal.org packaging script on 2016-10-10 -version: '8.x-1.0' -core: '8.x' +# Information added by Drupal.org packaging script on 2021-04-17 +version: '8.x-2.1' project: 'config_direct_save' -datestamp: 1476108244 +datestamp: 1618700638 diff --git a/web/modules/config_direct_save/config_direct_save.module b/web/modules/config_direct_save/config_direct_save.module index 983716f334620a6cba3d329eb58de7aece3fb85f..b1a1345b378e9a2f310d35a820923281063efadd 100644 --- a/web/modules/config_direct_save/config_direct_save.module +++ b/web/modules/config_direct_save/config_direct_save.module @@ -1,8 +1,8 @@ <?php + /** * @file * Allows to export configuration after changes. - * */ use Drupal\Core\Routing\RouteMatchInterface; diff --git a/web/modules/config_direct_save/src/Form/UpdateConfigurationForm.php b/web/modules/config_direct_save/src/Form/UpdateConfigurationForm.php index 9fe5caaad6bb96fcc8c353ba1d6950616605bb59..3256b94a9909e1b73b95f91a12dad68b7ffffb30 100644 --- a/web/modules/config_direct_save/src/Form/UpdateConfigurationForm.php +++ b/web/modules/config_direct_save/src/Form/UpdateConfigurationForm.php @@ -7,11 +7,12 @@ use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Component\Serialization\Yaml; +use Drupal\Core\Site\Settings; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provide the settings form for updating configurations. - * Class UpdateConfigurationForm + * * @package Drupal\config_direct_save\Form */ class UpdateConfigurationForm extends FormBase { @@ -35,12 +36,19 @@ class UpdateConfigurationForm extends FormBase { * @var \Drupal\Core\Config\ConfigManagerInterface */ protected $configManager; + /** - * Returns a unique string identifying the form. + * Constructs a ConfigController object. * - * @return string - * The unique string identifying the form. + * @param \Drupal\Core\Config\StorageInterface $target_storage + * The target storage. + * @param \Drupal\Core\Config\ConfigManagerInterface $config_manager + * Gets the config factory. */ + public function __construct(StorageInterface $target_storage, ConfigManagerInterface $config_manager) { + $this->targetStorage = $target_storage; + $this->configManager = $config_manager; + } /** * {@inheritdoc} @@ -53,18 +61,8 @@ public static function create(ContainerInterface $container) { } /** - * Constructs a ConfigController object. - * - * @param \Drupal\Core\Config\StorageInterface $target_storage - * The target storage. - * @param \Drupal\system\FileDownloadController $file_download_controller - * The file download controller. + * {@inheritdoc} */ - public function __construct(StorageInterface $target_storage, ConfigManagerInterface $config_manager) { - $this->targetStorage = $target_storage; - $this->configManager = $config_manager; - } - public function getFormId() { return 'config_update_form'; } @@ -81,22 +79,22 @@ public function getFormId() { * The form structure. */ public function buildForm(array $form, FormStateInterface $form_state) { - $form['config_directory'] = array( + $form['config_directory'] = [ '#type' => 'select', '#required' => TRUE, '#title' => $this->t('Config source'), '#description' => $this->t('Select config source directory'), - '#options' => array_flip($GLOBALS['config_directories']), - ); - $form['backup'] = array( + '#options' => array_flip(['sync' => Settings::get('config_sync_directory')]), + ]; + $form['backup'] = [ '#type' => 'checkbox', '#title' => $this->t('Backup'), - '#description' => $this->t('Check to make a backup for a specific config source(sync for example.)') - ); - $form['update'] = array( + '#description' => $this->t('Check to make a backup for a specific config source(sync for example.)'), + ]; + $form['update'] = [ '#type' => 'submit', '#value' => $this->t('Update configuration'), - ); + ]; return $form; } @@ -110,74 +108,79 @@ public function buildForm(array $form, FormStateInterface $form_state) { * The current state of the form. */ public function submitForm(array &$form, FormStateInterface $form_state) { - //Create config files. + // Create config files. $this->createConfigFiles($form, $form_state); } - /** - * Get the path of the directory. - * @param string $directory - * @return mixed - */ - protected function getConfigDirectory($directory = 'sync') { - $config_directories = $GLOBALS['config_directories'][$directory]; - return $config_directories; - } - /** * Override the old configurations. */ public function createConfigFiles(array &$form, FormStateInterface $form_state) { - //Get the name of config source( sync, text, etc...). + // Get the name of config source( sync, text, etc...). $config_directory_selected = $form_state->getValue('config_directory'); - //$config_manager = \Drupal::service('config.manager'); $config_files_names = $this->configManager->getConfigFactory()->listAll(); - //If the user check to make a backup, a directory will be created. + // If the user check to make a backup, a directory will be created. if ($form_state->getValue('backup')) { $current_date = date('d-m-Y-H-i-s'); $folder_backup = $config_directory_selected . "-" . $current_date; - $this->recurse_copy($config_directory_selected, $folder_backup); + $this->recurseCopy($config_directory_selected, $folder_backup); + } + // Delete old configurations files( except .htaccess). + $this->unlinkRecursive($config_directory_selected, 'yml'); + foreach ($config_files_names as $name) { + // Data associated to file. + $data = Yaml::encode($this->configManager->getConfigFactory() + ->get($name) + ->getRawData()); + // Create new files. + file_put_contents($config_directory_selected . "/$name.yml", $data); } - //Delete old configurations files( except .htaccess). - $this->unlink_recursive($config_directory_selected, 'yml'); - foreach ($config_files_names as $name) { - //Data associated to file. - $data = Yaml::encode($this->configManager->getConfigFactory() - ->get($name) - ->getRawData()); - //Create new files. - file_put_contents($config_directory_selected . "/$name.yml", $data); + // Get all override data from the remaining collections. + foreach ($this->targetStorage->getAllCollectionNames() as $collection) { + $target = str_replace('.', '/', $collection); + $this->unlinkRecursive($config_directory_selected . "/" . $target . "/", 'yml'); + if (!is_dir($config_directory_selected . "/" . $target . "/")) { + mkdir(($config_directory_selected . "/" . $target . "/"), 0775, TRUE); } - // Get all override data from the remaining collections. - foreach ($this->targetStorage->getAllCollectionNames() as $collection) { + $collection_storage = $this->targetStorage->createCollection($collection); + foreach ($collection_storage->listAll() as $name) { $target = str_replace('.', '/', $collection); - $this->unlink_recursive($config_directory_selected . "/" . $target . "/", 'yml'); - if (!is_dir($config_directory_selected . "$config_directory_selected." / ".$target." / "" . $target . "/")) { - mkdir(($config_directory_selected . "/" . $target . "/"), 0775, TRUE); + file_put_contents($config_directory_selected . "/" . $target . "/$name.yml", Yaml::encode($collection_storage->read($name))); + } + } + $this->messenger()->addMessage($this->t("The configuration has been uploaded.")); + } + + /** + * Copy the directory of. + */ + public function recurseCopy($src, $dst) { + $dir = opendir($src); + @mkdir($dst); + while (FALSE !== ($file = readdir($dir))) { + if (($file != '.') && ($file != '..')) { + if (is_dir($src . '/' . $file)) { + $this->recurseCopy($src . '/' . $file, $dst . '/' . $file); } - $collection_storage = $this->targetStorage->createCollection($collection); - foreach ($collection_storage->listAll() as $name) { - $target = str_replace('.', '/', $collection); - file_put_contents($config_directory_selected . "/" . $target . "/$name.yml", Yaml::encode($collection_storage->read($name))); + else { + copy($src . '/' . $file, $dst . '/' . $file); } } - drupal_set_message($this->t("The configuration has been uploaded.")); + } + closedir($dir); } - /*** + /** * Delete all configurations. - * @param $dir_name - * @param $ext - * @return bool */ - function unlink_recursive($dir_name, $ext) { - // Exit if there's no such directory + public function unlinkRecursive($dir_name, $ext) { + // Exit if there's no such directory. if (!file_exists($dir_name)) { return FALSE; } - // Open the target directory + // Open the target directory. $dir_handle = dir($dir_name); - // Take entries in the directory one at a time + // Take entries in the directory one at a time. while (FALSE !== ($entry = $dir_handle->read())) { if ($entry == '.' || $entry == '..') { continue; @@ -190,33 +193,14 @@ function unlink_recursive($dir_name, $ext) { } return FALSE; } - // Recurse on the children if the current entry happens to be a "directory" + // Recurse on the children if the current entry + // happens to be a "directory". if (is_dir($abs_name) || is_link($abs_name)) { - $this->unlink_recursive($abs_name, $ext); + $this->unlinkRecursive($abs_name, $ext); } } $dir_handle->close(); return TRUE; } - /** - * Copy the directory of - * @param $src - * @param $dst - */ - function recurse_copy($src, $dst) { - $dir = opendir($src); - @mkdir($dst); - while (FALSE !== ($file = readdir($dir))) { - if (($file != '.') && ($file != '..')) { - if (is_dir($src . '/' . $file)) { - $this->recurse_copy($src . '/' . $file, $dst . '/' . $file); - } - else { - copy($src . '/' . $file, $dst . '/' . $file); - } - } - } - closedir($dir); - } -} \ No newline at end of file +}