├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── README.md ├── SECURITY.md ├── class-debug-bar-timber.php ├── composer-install.sh ├── composer.json ├── composer.lock ├── debug-bar-timber.php ├── readme.txt ├── timber-debug-bar.css └── vendor ├── autoload.php ├── bin ├── var-dump-server └── var-dump-server.bat ├── composer ├── ClassLoader.php ├── InstalledVersions.php ├── LICENSE ├── autoload_classmap.php ├── autoload_files.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php ├── installed.json ├── installed.php └── platform_check.php └── symfony ├── polyfill-mbstring ├── LICENSE ├── Mbstring.php ├── README.md ├── Resources │ └── unidata │ │ ├── lowerCase.php │ │ ├── titleCaseRegexp.php │ │ └── upperCase.php ├── bootstrap.php ├── bootstrap80.php └── composer.json ├── polyfill-php74 ├── LICENSE ├── Php74.php ├── README.md ├── bootstrap.php └── composer.json └── var-dumper ├── CHANGELOG.md ├── Caster ├── AmqpCaster.php ├── ArgsStub.php ├── Caster.php ├── ClassStub.php ├── ConstStub.php ├── CutArrayStub.php ├── CutStub.php ├── DOMCaster.php ├── DateCaster.php ├── DoctrineCaster.php ├── DsCaster.php ├── DsPairStub.php ├── EnumStub.php ├── ExceptionCaster.php ├── FrameStub.php ├── GmpCaster.php ├── ImagineCaster.php ├── ImgStub.php ├── IntlCaster.php ├── LinkStub.php ├── MemcachedCaster.php ├── PdoCaster.php ├── PgSqlCaster.php ├── ProxyManagerCaster.php ├── RdKafkaCaster.php ├── RedisCaster.php ├── ReflectionCaster.php ├── ResourceCaster.php ├── SplCaster.php ├── StubCaster.php ├── SymfonyCaster.php ├── TraceStub.php ├── UuidCaster.php ├── XmlReaderCaster.php └── XmlResourceCaster.php ├── Cloner ├── AbstractCloner.php ├── ClonerInterface.php ├── Cursor.php ├── Data.php ├── DumperInterface.php ├── Stub.php └── VarCloner.php ├── Command ├── Descriptor │ ├── CliDescriptor.php │ ├── DumpDescriptorInterface.php │ └── HtmlDescriptor.php └── ServerDumpCommand.php ├── Dumper ├── AbstractDumper.php ├── CliDumper.php ├── ContextProvider │ ├── CliContextProvider.php │ ├── ContextProviderInterface.php │ ├── RequestContextProvider.php │ └── SourceContextProvider.php ├── ContextualizedDumper.php ├── DataDumperInterface.php ├── HtmlDumper.php └── ServerDumper.php ├── Exception └── ThrowingCasterException.php ├── LICENSE ├── README.md ├── Resources ├── bin │ └── var-dump-server ├── css │ └── htmlDescriptor.css ├── functions │ └── dump.php └── js │ └── htmlDescriptor.js ├── Server ├── Connection.php └── DumpServer.php ├── Test └── VarDumperTestTrait.php ├── VarDumper.php └── composer.json /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to WordPress.org 2 | on: 3 | push: 4 | tags: 5 | - "*" 6 | jobs: 7 | tag: 8 | name: New tag 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: WordPress Plugin Deploy 13 | uses: 10up/action-wordpress-plugin-deploy@1.5.0 14 | env: 15 | SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} 16 | SVN_USERNAME: ${{ secrets.SVN_USERNAME }} 17 | SLUG: debug-bar-timber 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .idea/workspace.xml 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | tdb-logo 3 |
4 | 5 | ## Timber Debug Bar 6 | 7 | Debug Bar Extension for the Timber Library. To use, you'll need the [WordPress Debug Bar](http://wordpress.org/plugins/debug-bar/) 8 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | | Version | Supported | 6 | | ------- | ------------------ | 7 | | 1.0.x | :white_check_mark: | 8 | | 0.0.x | :x: | 9 | 10 | ## Reporting a Vulnerability 11 | 12 | For the sake of protecting those who use this plugin, please send an email 13 | outlining the issue(s) to admin [at] manzwebdesigns [dot] com and thank you 14 | for using our plugin! 15 | -------------------------------------------------------------------------------- /class-debug-bar-timber.php: -------------------------------------------------------------------------------- 1 | 2 | php_files = array(); 24 | $this->datas = array(); 25 | $this->files = array(); 26 | $this->filenames = array(); 27 | $this->title('Timber'); 28 | add_action('wp_ajax_debug_bar_console', array($this, 'ajax')); 29 | 30 | $timber = new Timber(); 31 | if(version_compare($timber::$version, '2.0.0', '>=')) { 32 | add_action( 'timber/loader/render_file', array( $this, 'add_file' ) ); 33 | add_filter( 'timber/render/file', array( $this, 'render_file' ) ); 34 | add_filter( 'timber/loader/render_data', array( $this, 'render_data' ) ); 35 | add_filter( 'timber/calling_php_file', array( $this, 'add_php_file' ) ); 36 | add_filter( 'timber/calling_php_file', array( $this, 'add_php_file' ) ); 37 | } 38 | else { 39 | add_action('timber_loader_render_file', array($this, 'add_file')); 40 | add_filter('timber_render_file', array($this, 'render_file')); 41 | add_filter('timber_loader_render_data', array($this, 'render_data')); 42 | add_filter('timber/calling_php_file', array($this, 'add_php_file')); 43 | add_filter('timber_calling_php_file', array($this, 'add_php_file')); 44 | } 45 | } 46 | 47 | /** 48 | * @param $php_file 49 | * 50 | * @return mixed 51 | */ 52 | public function add_php_file($php_file){ 53 | $this->php_files[] = $php_file; 54 | return $php_file; 55 | } 56 | 57 | /** 58 | * @param $file 59 | */ 60 | public function add_file($file): void { 61 | $this->files[] = $file; 62 | } 63 | 64 | /** 65 | * @param $file 66 | * 67 | * @return mixed 68 | */ 69 | public function render_file($file) { 70 | $this->filenames[] = $file; 71 | return $file; 72 | } 73 | 74 | /** 75 | * @param $data 76 | * 77 | * @return mixed 78 | */ 79 | public function render_data($data) { 80 | $this->datas[] = $data; 81 | return $data; 82 | } 83 | 84 | 85 | public function prerender(): void { 86 | $this->set_visible(true); 87 | } 88 | 89 | /** 90 | * @param mixed ...$vars 91 | */ 92 | public function dumpAll(...$vars): void { 93 | foreach ($vars as $v) { 94 | VarDumper::dump($v); 95 | } 96 | } 97 | 98 | public function render(): void { 99 | $i = 0; 100 | foreach($this->filenames as $filename){ 101 | echo '

'.$filename.'

'; 102 | } 103 | if (isset($this->php_files) && is_array($this->php_files)){ 104 | $this->php_files = array_unique($this->php_files); 105 | foreach($this->php_files as $php_file){ 106 | echo '

Called from '.$php_file.'

'; 107 | } 108 | } 109 | foreach($this->files as $file){ 110 | echo "

Timber found template: ".$file.". Here's the data that you sent:

"; 111 | if (count($this->datas) && isset($this->datas[$i])){ 112 | 113 | $data = $this->datas[$i]; 114 | 115 | if (array_key_exists("post",$data)){ 116 | 117 | echo "

Post Data

"; 118 | $this->dumpAll($data["post"]); 119 | 120 | echo "

Author Data

"; 121 | $this->dumpAll($data["post"]->author); 122 | } 123 | 124 | echo "

Other Data

"; 125 | $this->dumpAll($data); 126 | 127 | echo '{# expected variables:'; 128 | $dataKeyNames = array_keys( $data ); 129 | $i = 0; 130 | foreach ( $data as $d ) { 131 | if( is_array($d) ) { 132 | $varName = $dataKeyNames[$i]; 133 | $arrayKeynames = array_keys((array) $d[0]); 134 | $keynames = ''; 135 | foreach ( $arrayKeynames as $array_keyname ) { 136 | $keynames .= "'" . $array_keyname . "', "; 137 | } 138 | $keynames = substr($keynames, 0, -2 ); 139 | echo "
$varName: array of the form array[0][X] where X is $keynames
"; 140 | } 141 | $i++; 142 | } 143 | echo '#}
'; 144 | } 145 | $i++; 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /composer-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -f "composer.lock" ] 4 | then 5 | rm composer.lock 6 | fi 7 | 8 | EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)" 9 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 10 | ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" 11 | 12 | if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] 13 | then 14 | >&2 echo 'ERROR: Invalid installer checksum' 15 | rm composer-setup.php 16 | exit 1 17 | fi 18 | 19 | php composer-setup.php --quiet 20 | rm composer-setup.php 21 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "repositories": [], 3 | "require": { 4 | "symfony/polyfill-php74": "^1.17", 5 | "symfony/var-dumper": "5.2.*" 6 | }, 7 | "require-dev": { 8 | "roave/security-advisories": "dev-latest" 9 | }, 10 | "options": { 11 | "symlink": false 12 | }, 13 | "config": { 14 | "preferred-install": { 15 | "*": "dist" 16 | }, 17 | "sort-packages": true 18 | }, 19 | "replace": { 20 | "symfony/polyfill-php80": "*", 21 | "symfony/polyfill-php74": "*" 22 | }, 23 | "name": "timber/debug-bar-timber", 24 | "description": "" 25 | } 26 | -------------------------------------------------------------------------------- /debug-bar-timber.php: -------------------------------------------------------------------------------- 1 | WordPress Debug Bar Plugin"; 30 | 31 | add_action( 'admin_notices', static function() use ( $text, $class ) { 32 | echo '

'.$text.'

'; 33 | }, 1 ); 34 | } 35 | }); 36 | 37 | function tdb_enqueue_styles() { 38 | wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' ); 39 | } 40 | add_action( 'wp_enqueue_scripts', 'tdb_enqueue_styles', 99 ); 41 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Plugin Name === 2 | Contributors: jarednova, manzwebdesigns 3 | Tags: timber, debug, twig 4 | Requires at least: 3.5 5 | Tested up to: 5.9.1 6 | Stable tag: 1.1.8 7 | License: GPLv2 or later 8 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 | 10 | Adds a Panel to the Debug Bar for Timber information 11 | 12 | == Description == 13 | 14 | Once installed, the Timber Debug Bar gives you access to the current template name, its absolute location on your server and the full contents of the context (array) sent to the template. 15 | 16 | == Installation == 17 | 18 | 1. Install the [Debug Bar](http://wordpress.org/plugins/debug-bar/) plugin 19 | 1. Upload `debug-bar-timber` directory to the `/wp-content/plugins/` directory 20 | 1. Run `composer install` 21 | 1. Activate the plugin through the 'Plugins' menu in WordPress 22 | 23 | == Frequently Asked Questions == 24 | 25 | = What's Timber? = 26 | 27 | Timber is a plugin that lets you use the Twig Template Language in your themes. [Download it](http://wordpress.org/plugins/timber-library/) from WordPress.org 28 | -------------------------------------------------------------------------------- /timber-debug-bar.css: -------------------------------------------------------------------------------- 1 | #debug-menu-targets h3 { 2 | display: block; 3 | font-size: 24px; 4 | font-weight: bold; 5 | font-family: Consolas, mono, serif; 6 | color: #111; 7 | } 8 | 9 | #debug-menu-targets h4 { 10 | display: block; 11 | font-size: 18px; 12 | font-weight: bold; 13 | font-family: Consolas, mono, serif; 14 | color: #AAA; 15 | } 16 | 17 | #debug-menu-targets h4 span { 18 | color: #111; 19 | } 20 | 21 | #debug-menu-targets code { 22 | font-family: Consolas, mono, serif; 23 | } 24 | 25 | #debug-bar-actions span { 26 | padding: 3px; 27 | } 28 | 29 | #debug-menu-links li a#debug-menu-link-Debug_Bar_JS, #wp-admin-bar-debug-bar-Debug_Bar_JS { 30 | display: block; 31 | } 32 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | realpath = realpath($opened_path) ?: $opened_path; 34 | $opened_path = $this->realpath; 35 | $this->handle = fopen($this->realpath, $mode); 36 | $this->position = 0; 37 | 38 | return (bool) $this->handle; 39 | } 40 | 41 | public function stream_read($count) 42 | { 43 | $data = fread($this->handle, $count); 44 | 45 | if ($this->position === 0) { 46 | $data = preg_replace('{^#!.*\r?\n}', '', $data); 47 | } 48 | 49 | $this->position += strlen($data); 50 | 51 | return $data; 52 | } 53 | 54 | public function stream_cast($castAs) 55 | { 56 | return $this->handle; 57 | } 58 | 59 | public function stream_close() 60 | { 61 | fclose($this->handle); 62 | } 63 | 64 | public function stream_lock($operation) 65 | { 66 | return $operation ? flock($this->handle, $operation) : true; 67 | } 68 | 69 | public function stream_seek($offset, $whence) 70 | { 71 | if (0 === fseek($this->handle, $offset, $whence)) { 72 | $this->position = ftell($this->handle); 73 | return true; 74 | } 75 | 76 | return false; 77 | } 78 | 79 | public function stream_tell() 80 | { 81 | return $this->position; 82 | } 83 | 84 | public function stream_eof() 85 | { 86 | return feof($this->handle); 87 | } 88 | 89 | public function stream_stat() 90 | { 91 | return array(); 92 | } 93 | 94 | public function stream_set_option($option, $arg1, $arg2) 95 | { 96 | return true; 97 | } 98 | 99 | public function url_stat($path, $flags) 100 | { 101 | $path = substr($path, 17); 102 | if (file_exists($path)) { 103 | return stat($path); 104 | } 105 | 106 | return false; 107 | } 108 | } 109 | } 110 | 111 | if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { 112 | include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'); 113 | exit(0); 114 | } 115 | } 116 | 117 | include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'; 118 | -------------------------------------------------------------------------------- /vendor/bin/var-dump-server.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | setlocal DISABLEDELAYEDEXPANSION 3 | SET BIN_TARGET=%~dp0/var-dump-server 4 | SET COMPOSER_BIN_DIR=%~dp0 5 | php "%BIN_TARGET%" %* 6 | -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /vendor/composer/autoload_classmap.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/composer/InstalledVersions.php', 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 10 | '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 11 | ); 12 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/symfony/polyfill-mbstring'), 10 | 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), 11 | ); 12 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 32 | if ($useStaticLoader) { 33 | require __DIR__ . '/autoload_static.php'; 34 | 35 | call_user_func(\Composer\Autoload\ComposerStaticInit9f05765d0434328edea0c5e38128d4a8::getInitializer($loader)); 36 | } else { 37 | $map = require __DIR__ . '/autoload_namespaces.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->set($namespace, $path); 40 | } 41 | 42 | $map = require __DIR__ . '/autoload_psr4.php'; 43 | foreach ($map as $namespace => $path) { 44 | $loader->setPsr4($namespace, $path); 45 | } 46 | 47 | $classMap = require __DIR__ . '/autoload_classmap.php'; 48 | if ($classMap) { 49 | $loader->addClassMap($classMap); 50 | } 51 | } 52 | 53 | $loader->register(true); 54 | 55 | if ($useStaticLoader) { 56 | $includeFiles = Composer\Autoload\ComposerStaticInit9f05765d0434328edea0c5e38128d4a8::$files; 57 | } else { 58 | $includeFiles = require __DIR__ . '/autoload_files.php'; 59 | } 60 | foreach ($includeFiles as $fileIdentifier => $file) { 61 | composerRequire9f05765d0434328edea0c5e38128d4a8($fileIdentifier, $file); 62 | } 63 | 64 | return $loader; 65 | } 66 | } 67 | 68 | /** 69 | * @param string $fileIdentifier 70 | * @param string $file 71 | * @return void 72 | */ 73 | function composerRequire9f05765d0434328edea0c5e38128d4a8($fileIdentifier, $file) 74 | { 75 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 76 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 77 | 78 | require $file; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', 11 | '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 12 | ); 13 | 14 | public static $prefixLengthsPsr4 = array ( 15 | 'S' => 16 | array ( 17 | 'Symfony\\Polyfill\\Mbstring\\' => 26, 18 | 'Symfony\\Component\\VarDumper\\' => 28, 19 | ), 20 | ); 21 | 22 | public static $prefixDirsPsr4 = array ( 23 | 'Symfony\\Polyfill\\Mbstring\\' => 24 | array ( 25 | 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', 26 | ), 27 | 'Symfony\\Component\\VarDumper\\' => 28 | array ( 29 | 0 => __DIR__ . '/..' . '/symfony/var-dumper', 30 | ), 31 | ); 32 | 33 | public static $classMap = array ( 34 | 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 35 | ); 36 | 37 | public static function getInitializer(ClassLoader $loader) 38 | { 39 | return \Closure::bind(function () use ($loader) { 40 | $loader->prefixLengthsPsr4 = ComposerStaticInit9f05765d0434328edea0c5e38128d4a8::$prefixLengthsPsr4; 41 | $loader->prefixDirsPsr4 = ComposerStaticInit9f05765d0434328edea0c5e38128d4a8::$prefixDirsPsr4; 42 | $loader->classMap = ComposerStaticInit9f05765d0434328edea0c5e38128d4a8::$classMap; 43 | 44 | }, null, ClassLoader::class); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/composer/installed.php: -------------------------------------------------------------------------------- 1 | array( 3 | 'pretty_version' => 'dev-master', 4 | 'version' => 'dev-master', 5 | 'type' => 'library', 6 | 'install_path' => __DIR__ . '/../../', 7 | 'aliases' => array(), 8 | 'reference' => 'a4edcf362a0e2bce85a68d2dd851162875d52d56', 9 | 'name' => 'timber/debug-bar-timber', 10 | 'dev' => true, 11 | ), 12 | 'versions' => array( 13 | 'roave/security-advisories' => array( 14 | 'pretty_version' => 'dev-latest', 15 | 'version' => 'dev-latest', 16 | 'type' => 'metapackage', 17 | 'install_path' => NULL, 18 | 'aliases' => array( 19 | 0 => '9999999-dev', 20 | ), 21 | 'reference' => '9461fa5df0b505bbe4404f20b1759884a27c7572', 22 | 'dev_requirement' => true, 23 | ), 24 | 'symfony/polyfill-mbstring' => array( 25 | 'pretty_version' => 'v1.25.0', 26 | 'version' => '1.25.0.0', 27 | 'type' => 'library', 28 | 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 29 | 'aliases' => array(), 30 | 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', 31 | 'dev_requirement' => false, 32 | ), 33 | 'symfony/polyfill-php74' => array( 34 | 'dev_requirement' => false, 35 | 'replaced' => array( 36 | 0 => '*', 37 | ), 38 | ), 39 | 'symfony/polyfill-php80' => array( 40 | 'dev_requirement' => false, 41 | 'replaced' => array( 42 | 0 => '*', 43 | ), 44 | ), 45 | 'symfony/var-dumper' => array( 46 | 'pretty_version' => 'v5.2.12', 47 | 'version' => '5.2.12.0', 48 | 'type' => 'library', 49 | 'install_path' => __DIR__ . '/../symfony/var-dumper', 50 | 'aliases' => array(), 51 | 'reference' => 'd5f42c357a6672d4e5960bba85e437850e9a7abb', 52 | 'dev_requirement' => false, 53 | ), 54 | 'timber/debug-bar-timber' => array( 55 | 'pretty_version' => 'dev-master', 56 | 'version' => 'dev-master', 57 | 'type' => 'library', 58 | 'install_path' => __DIR__ . '/../../', 59 | 'aliases' => array(), 60 | 'reference' => 'a4edcf362a0e2bce85a68d2dd851162875d52d56', 61 | 'dev_requirement' => false, 62 | ), 63 | ), 64 | ); 65 | -------------------------------------------------------------------------------- /vendor/composer/platform_check.php: -------------------------------------------------------------------------------- 1 | = 70205)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; 20 | } 21 | } 22 | trigger_error( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 | E_USER_ERROR 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2019 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Mbstring 2 | =========================== 3 | 4 | This component provides a partial, native PHP implementation for the 5 | [Mbstring](https://php.net/mbstring) extension. 6 | 7 | More information can be found in the 8 | [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). 9 | 10 | License 11 | ======= 12 | 13 | This library is released under the [MIT license](LICENSE). 14 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Mbstring as p; 13 | 14 | if (\PHP_VERSION_ID >= 80000) { 15 | return require __DIR__.'/bootstrap80.php'; 16 | } 17 | 18 | if (!function_exists('mb_convert_encoding')) { 19 | function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } 20 | } 21 | if (!function_exists('mb_decode_mimeheader')) { 22 | function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } 23 | } 24 | if (!function_exists('mb_encode_mimeheader')) { 25 | function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } 26 | } 27 | if (!function_exists('mb_decode_numericentity')) { 28 | function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } 29 | } 30 | if (!function_exists('mb_encode_numericentity')) { 31 | function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } 32 | } 33 | if (!function_exists('mb_convert_case')) { 34 | function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } 35 | } 36 | if (!function_exists('mb_internal_encoding')) { 37 | function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } 38 | } 39 | if (!function_exists('mb_language')) { 40 | function mb_language($language = null) { return p\Mbstring::mb_language($language); } 41 | } 42 | if (!function_exists('mb_list_encodings')) { 43 | function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } 44 | } 45 | if (!function_exists('mb_encoding_aliases')) { 46 | function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } 47 | } 48 | if (!function_exists('mb_check_encoding')) { 49 | function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } 50 | } 51 | if (!function_exists('mb_detect_encoding')) { 52 | function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } 53 | } 54 | if (!function_exists('mb_detect_order')) { 55 | function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } 56 | } 57 | if (!function_exists('mb_parse_str')) { 58 | function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } 59 | } 60 | if (!function_exists('mb_strlen')) { 61 | function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } 62 | } 63 | if (!function_exists('mb_strpos')) { 64 | function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } 65 | } 66 | if (!function_exists('mb_strtolower')) { 67 | function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } 68 | } 69 | if (!function_exists('mb_strtoupper')) { 70 | function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } 71 | } 72 | if (!function_exists('mb_substitute_character')) { 73 | function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } 74 | } 75 | if (!function_exists('mb_substr')) { 76 | function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } 77 | } 78 | if (!function_exists('mb_stripos')) { 79 | function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } 80 | } 81 | if (!function_exists('mb_stristr')) { 82 | function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } 83 | } 84 | if (!function_exists('mb_strrchr')) { 85 | function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } 86 | } 87 | if (!function_exists('mb_strrichr')) { 88 | function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } 89 | } 90 | if (!function_exists('mb_strripos')) { 91 | function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } 92 | } 93 | if (!function_exists('mb_strrpos')) { 94 | function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } 95 | } 96 | if (!function_exists('mb_strstr')) { 97 | function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } 98 | } 99 | if (!function_exists('mb_get_info')) { 100 | function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } 101 | } 102 | if (!function_exists('mb_http_output')) { 103 | function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } 104 | } 105 | if (!function_exists('mb_strwidth')) { 106 | function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } 107 | } 108 | if (!function_exists('mb_substr_count')) { 109 | function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } 110 | } 111 | if (!function_exists('mb_output_handler')) { 112 | function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } 113 | } 114 | if (!function_exists('mb_http_input')) { 115 | function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } 116 | } 117 | 118 | if (!function_exists('mb_convert_variables')) { 119 | function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } 120 | } 121 | 122 | if (!function_exists('mb_ord')) { 123 | function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } 124 | } 125 | if (!function_exists('mb_chr')) { 126 | function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } 127 | } 128 | if (!function_exists('mb_scrub')) { 129 | function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } 130 | } 131 | if (!function_exists('mb_str_split')) { 132 | function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } 133 | } 134 | 135 | if (extension_loaded('mbstring')) { 136 | return; 137 | } 138 | 139 | if (!defined('MB_CASE_UPPER')) { 140 | define('MB_CASE_UPPER', 0); 141 | } 142 | if (!defined('MB_CASE_LOWER')) { 143 | define('MB_CASE_LOWER', 1); 144 | } 145 | if (!defined('MB_CASE_TITLE')) { 146 | define('MB_CASE_TITLE', 2); 147 | } 148 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/bootstrap80.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Mbstring as p; 13 | 14 | if (!function_exists('mb_convert_encoding')) { 15 | function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } 16 | } 17 | if (!function_exists('mb_decode_mimeheader')) { 18 | function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } 19 | } 20 | if (!function_exists('mb_encode_mimeheader')) { 21 | function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } 22 | } 23 | if (!function_exists('mb_decode_numericentity')) { 24 | function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } 25 | } 26 | if (!function_exists('mb_encode_numericentity')) { 27 | function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } 28 | } 29 | if (!function_exists('mb_convert_case')) { 30 | function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } 31 | } 32 | if (!function_exists('mb_internal_encoding')) { 33 | function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } 34 | } 35 | if (!function_exists('mb_language')) { 36 | function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } 37 | } 38 | if (!function_exists('mb_list_encodings')) { 39 | function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } 40 | } 41 | if (!function_exists('mb_encoding_aliases')) { 42 | function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } 43 | } 44 | if (!function_exists('mb_check_encoding')) { 45 | function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } 46 | } 47 | if (!function_exists('mb_detect_encoding')) { 48 | function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } 49 | } 50 | if (!function_exists('mb_detect_order')) { 51 | function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } 52 | } 53 | if (!function_exists('mb_parse_str')) { 54 | function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } 55 | } 56 | if (!function_exists('mb_strlen')) { 57 | function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } 58 | } 59 | if (!function_exists('mb_strpos')) { 60 | function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } 61 | } 62 | if (!function_exists('mb_strtolower')) { 63 | function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } 64 | } 65 | if (!function_exists('mb_strtoupper')) { 66 | function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } 67 | } 68 | if (!function_exists('mb_substitute_character')) { 69 | function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } 70 | } 71 | if (!function_exists('mb_substr')) { 72 | function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } 73 | } 74 | if (!function_exists('mb_stripos')) { 75 | function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } 76 | } 77 | if (!function_exists('mb_stristr')) { 78 | function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } 79 | } 80 | if (!function_exists('mb_strrchr')) { 81 | function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } 82 | } 83 | if (!function_exists('mb_strrichr')) { 84 | function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } 85 | } 86 | if (!function_exists('mb_strripos')) { 87 | function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } 88 | } 89 | if (!function_exists('mb_strrpos')) { 90 | function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } 91 | } 92 | if (!function_exists('mb_strstr')) { 93 | function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } 94 | } 95 | if (!function_exists('mb_get_info')) { 96 | function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } 97 | } 98 | if (!function_exists('mb_http_output')) { 99 | function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } 100 | } 101 | if (!function_exists('mb_strwidth')) { 102 | function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } 103 | } 104 | if (!function_exists('mb_substr_count')) { 105 | function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } 106 | } 107 | if (!function_exists('mb_output_handler')) { 108 | function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } 109 | } 110 | if (!function_exists('mb_http_input')) { 111 | function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } 112 | } 113 | 114 | if (!function_exists('mb_convert_variables')) { 115 | function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } 116 | } 117 | 118 | if (!function_exists('mb_ord')) { 119 | function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } 120 | } 121 | if (!function_exists('mb_chr')) { 122 | function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } 123 | } 124 | if (!function_exists('mb_scrub')) { 125 | function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } 126 | } 127 | if (!function_exists('mb_str_split')) { 128 | function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } 129 | } 130 | 131 | if (extension_loaded('mbstring')) { 132 | return; 133 | } 134 | 135 | if (!defined('MB_CASE_UPPER')) { 136 | define('MB_CASE_UPPER', 0); 137 | } 138 | if (!defined('MB_CASE_LOWER')) { 139 | define('MB_CASE_LOWER', 1); 140 | } 141 | if (!defined('MB_CASE_TITLE')) { 142 | define('MB_CASE_TITLE', 2); 143 | } 144 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-mbstring", 3 | "type": "library", 4 | "description": "Symfony polyfill for the Mbstring extension", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.1" 20 | }, 21 | "provide": { 22 | "ext-mbstring": "*" 23 | }, 24 | "autoload": { 25 | "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, 26 | "files": [ "bootstrap.php" ] 27 | }, 28 | "suggest": { 29 | "ext-mbstring": "For best performance" 30 | }, 31 | "minimum-stability": "dev", 32 | "extra": { 33 | "branch-alias": { 34 | "dev-main": "1.23-dev" 35 | }, 36 | "thanks": { 37 | "name": "symfony/polyfill", 38 | "url": "https://github.com/symfony/polyfill" 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php74/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php74/Php74.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Polyfill\Php74; 13 | 14 | /** 15 | * @author Ion Bazan 16 | * 17 | * @internal 18 | */ 19 | final class Php74 20 | { 21 | public static function get_mangled_object_vars($obj) 22 | { 23 | if (!\is_object($obj)) { 24 | trigger_error('get_mangled_object_vars() expects parameter 1 to be object, '.\gettype($obj).' given', \E_USER_WARNING); 25 | 26 | return null; 27 | } 28 | 29 | if ($obj instanceof \ArrayIterator || $obj instanceof \ArrayObject) { 30 | $reflector = new \ReflectionClass($obj instanceof \ArrayIterator ? 'ArrayIterator' : 'ArrayObject'); 31 | $flags = $reflector->getMethod('getFlags')->invoke($obj); 32 | $reflector = $reflector->getMethod('setFlags'); 33 | 34 | $reflector->invoke($obj, ($flags & \ArrayObject::STD_PROP_LIST) ? 0 : \ArrayObject::STD_PROP_LIST); 35 | $arr = (array) $obj; 36 | $reflector->invoke($obj, $flags); 37 | } else { 38 | $arr = (array) $obj; 39 | } 40 | 41 | return array_combine(array_keys($arr), array_values($arr)); 42 | } 43 | 44 | public static function mb_str_split($string, $split_length = 1, $encoding = null) 45 | { 46 | if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { 47 | trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); 48 | 49 | return null; 50 | } 51 | 52 | if (1 > $split_length = (int) $split_length) { 53 | trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); 54 | 55 | return false; 56 | } 57 | 58 | if (null === $encoding) { 59 | $encoding = mb_internal_encoding(); 60 | } 61 | 62 | if ('UTF-8' === $encoding || \in_array(strtoupper($encoding), ['UTF-8', 'UTF8'], true)) { 63 | return preg_split("/(.{{$split_length}})/u", $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); 64 | } 65 | 66 | $result = []; 67 | $length = mb_strlen($string, $encoding); 68 | 69 | for ($i = 0; $i < $length; $i += $split_length) { 70 | $result[] = mb_substr($string, $i, $split_length, $encoding); 71 | } 72 | 73 | return $result; 74 | } 75 | 76 | public static function password_algos() 77 | { 78 | $algos = []; 79 | 80 | if (\defined('PASSWORD_BCRYPT')) { 81 | $algos[] = \PASSWORD_BCRYPT; 82 | } 83 | 84 | if (\defined('PASSWORD_ARGON2I')) { 85 | $algos[] = \PASSWORD_ARGON2I; 86 | } 87 | 88 | if (\defined('PASSWORD_ARGON2ID')) { 89 | $algos[] = \PASSWORD_ARGON2ID; 90 | } 91 | 92 | return $algos; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php74/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Php74 2 | ======================== 3 | 4 | This component provides functions added to PHP 7.4 core: 5 | 6 | - [`get_mangled_object_vars`](https://php.net/get_mangled_object_vars) 7 | - [`mb_str_split`](https://php.net/mb_str_split) 8 | - [`password_algos`](https://php.net/password_algos) 9 | 10 | More information can be found in the 11 | [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). 12 | 13 | License 14 | ======= 15 | 16 | This library is released under the [MIT license](LICENSE). 17 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php74/bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Php74 as p; 13 | 14 | if (\PHP_VERSION_ID >= 70400) { 15 | return; 16 | } 17 | 18 | if (!function_exists('get_mangled_object_vars')) { 19 | function get_mangled_object_vars($object) { return p\Php74::get_mangled_object_vars($object); } 20 | } 21 | if (!function_exists('mb_str_split') && function_exists('mb_substr')) { 22 | function mb_str_split($string, $length = 1, $encoding = null) { return p\Php74::mb_str_split($string, $length, $encoding); } 23 | } 24 | if (!function_exists('password_algos')) { 25 | function password_algos() { return p\Php74::password_algos(); } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php74/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-php74", 3 | "type": "library", 4 | "description": "Symfony polyfill backporting some PHP 7.4+ features to lower PHP versions", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Ion Bazan", 11 | "email": "ion.bazan@gmail.com" 12 | }, 13 | { 14 | "name": "Nicolas Grekas", 15 | "email": "p@tchwork.com" 16 | }, 17 | { 18 | "name": "Symfony Community", 19 | "homepage": "https://symfony.com/contributors" 20 | } 21 | ], 22 | "require": { 23 | "php": ">=7.1" 24 | }, 25 | "autoload": { 26 | "psr-4": { "Symfony\\Polyfill\\Php74\\": "" }, 27 | "files": [ "bootstrap.php" ] 28 | }, 29 | "minimum-stability": "dev", 30 | "extra": { 31 | "branch-alias": { 32 | "dev-main": "1.22-dev" 33 | }, 34 | "thanks": { 35 | "name": "symfony/polyfill", 36 | "url": "https://github.com/symfony/polyfill" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | 5.2.0 5 | ----- 6 | 7 | * added support for PHPUnit `--colors` option 8 | * added `VAR_DUMPER_FORMAT=server` env var value support 9 | * prevent replacing the handler when the `VAR_DUMPER_FORMAT` env var is set 10 | 11 | 5.1.0 12 | ----- 13 | 14 | * added `RdKafka` support 15 | 16 | 4.4.0 17 | ----- 18 | 19 | * added `VarDumperTestTrait::setUpVarDumper()` and `VarDumperTestTrait::tearDownVarDumper()` 20 | to configure casters & flags to use in tests 21 | * added `ImagineCaster` and infrastructure to dump images 22 | * added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data 23 | * added `UuidCaster` 24 | * made all casters final 25 | * added support for the `NO_COLOR` env var (https://no-color.org/) 26 | 27 | 4.3.0 28 | ----- 29 | 30 | * added `DsCaster` to support dumping the contents of data structures from the Ds extension 31 | 32 | 4.2.0 33 | ----- 34 | 35 | * support selecting the format to use by setting the environment variable `VAR_DUMPER_FORMAT` to `html` or `cli` 36 | 37 | 4.1.0 38 | ----- 39 | 40 | * added a `ServerDumper` to send serialized Data clones to a server 41 | * added a `ServerDumpCommand` and `DumpServer` to run a server collecting 42 | and displaying dumps on a single place with multiple formats support 43 | * added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support 44 | 45 | 4.0.0 46 | ----- 47 | 48 | * support for passing `\ReflectionClass` instances to the `Caster::castObject()` 49 | method has been dropped, pass class names as strings instead 50 | * the `Data::getRawData()` method has been removed 51 | * the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0` 52 | argument and moves `$message = ''` argument at 4th position. 53 | * the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0` 54 | argument and moves `$message = ''` argument at 4th position. 55 | 56 | 3.4.0 57 | ----- 58 | 59 | * added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth 60 | * deprecated `MongoCaster` 61 | 62 | 2.7.0 63 | ----- 64 | 65 | * deprecated `Cloner\Data::getLimitedClone()`. Use `withMaxDepth`, `withMaxItemsPerDepth` or `withRefHandles` instead. 66 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/AmqpCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts Amqp related classes to array representation. 18 | * 19 | * @author Grégoire Pineau 20 | * 21 | * @final 22 | */ 23 | class AmqpCaster 24 | { 25 | private const FLAGS = [ 26 | \AMQP_DURABLE => 'AMQP_DURABLE', 27 | \AMQP_PASSIVE => 'AMQP_PASSIVE', 28 | \AMQP_EXCLUSIVE => 'AMQP_EXCLUSIVE', 29 | \AMQP_AUTODELETE => 'AMQP_AUTODELETE', 30 | \AMQP_INTERNAL => 'AMQP_INTERNAL', 31 | \AMQP_NOLOCAL => 'AMQP_NOLOCAL', 32 | \AMQP_AUTOACK => 'AMQP_AUTOACK', 33 | \AMQP_IFEMPTY => 'AMQP_IFEMPTY', 34 | \AMQP_IFUNUSED => 'AMQP_IFUNUSED', 35 | \AMQP_MANDATORY => 'AMQP_MANDATORY', 36 | \AMQP_IMMEDIATE => 'AMQP_IMMEDIATE', 37 | \AMQP_MULTIPLE => 'AMQP_MULTIPLE', 38 | \AMQP_NOWAIT => 'AMQP_NOWAIT', 39 | \AMQP_REQUEUE => 'AMQP_REQUEUE', 40 | ]; 41 | 42 | private const EXCHANGE_TYPES = [ 43 | \AMQP_EX_TYPE_DIRECT => 'AMQP_EX_TYPE_DIRECT', 44 | \AMQP_EX_TYPE_FANOUT => 'AMQP_EX_TYPE_FANOUT', 45 | \AMQP_EX_TYPE_TOPIC => 'AMQP_EX_TYPE_TOPIC', 46 | \AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS', 47 | ]; 48 | 49 | public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested) 50 | { 51 | $prefix = Caster::PREFIX_VIRTUAL; 52 | 53 | $a += [ 54 | $prefix.'is_connected' => $c->isConnected(), 55 | ]; 56 | 57 | // Recent version of the extension already expose private properties 58 | if (isset($a["\x00AMQPConnection\x00login"])) { 59 | return $a; 60 | } 61 | 62 | // BC layer in the amqp lib 63 | if (method_exists($c, 'getReadTimeout')) { 64 | $timeout = $c->getReadTimeout(); 65 | } else { 66 | $timeout = $c->getTimeout(); 67 | } 68 | 69 | $a += [ 70 | $prefix.'is_connected' => $c->isConnected(), 71 | $prefix.'login' => $c->getLogin(), 72 | $prefix.'password' => $c->getPassword(), 73 | $prefix.'host' => $c->getHost(), 74 | $prefix.'vhost' => $c->getVhost(), 75 | $prefix.'port' => $c->getPort(), 76 | $prefix.'read_timeout' => $timeout, 77 | ]; 78 | 79 | return $a; 80 | } 81 | 82 | public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested) 83 | { 84 | $prefix = Caster::PREFIX_VIRTUAL; 85 | 86 | $a += [ 87 | $prefix.'is_connected' => $c->isConnected(), 88 | $prefix.'channel_id' => $c->getChannelId(), 89 | ]; 90 | 91 | // Recent version of the extension already expose private properties 92 | if (isset($a["\x00AMQPChannel\x00connection"])) { 93 | return $a; 94 | } 95 | 96 | $a += [ 97 | $prefix.'connection' => $c->getConnection(), 98 | $prefix.'prefetch_size' => $c->getPrefetchSize(), 99 | $prefix.'prefetch_count' => $c->getPrefetchCount(), 100 | ]; 101 | 102 | return $a; 103 | } 104 | 105 | public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested) 106 | { 107 | $prefix = Caster::PREFIX_VIRTUAL; 108 | 109 | $a += [ 110 | $prefix.'flags' => self::extractFlags($c->getFlags()), 111 | ]; 112 | 113 | // Recent version of the extension already expose private properties 114 | if (isset($a["\x00AMQPQueue\x00name"])) { 115 | return $a; 116 | } 117 | 118 | $a += [ 119 | $prefix.'connection' => $c->getConnection(), 120 | $prefix.'channel' => $c->getChannel(), 121 | $prefix.'name' => $c->getName(), 122 | $prefix.'arguments' => $c->getArguments(), 123 | ]; 124 | 125 | return $a; 126 | } 127 | 128 | public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested) 129 | { 130 | $prefix = Caster::PREFIX_VIRTUAL; 131 | 132 | $a += [ 133 | $prefix.'flags' => self::extractFlags($c->getFlags()), 134 | ]; 135 | 136 | $type = isset(self::EXCHANGE_TYPES[$c->getType()]) ? new ConstStub(self::EXCHANGE_TYPES[$c->getType()], $c->getType()) : $c->getType(); 137 | 138 | // Recent version of the extension already expose private properties 139 | if (isset($a["\x00AMQPExchange\x00name"])) { 140 | $a["\x00AMQPExchange\x00type"] = $type; 141 | 142 | return $a; 143 | } 144 | 145 | $a += [ 146 | $prefix.'connection' => $c->getConnection(), 147 | $prefix.'channel' => $c->getChannel(), 148 | $prefix.'name' => $c->getName(), 149 | $prefix.'type' => $type, 150 | $prefix.'arguments' => $c->getArguments(), 151 | ]; 152 | 153 | return $a; 154 | } 155 | 156 | public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0) 157 | { 158 | $prefix = Caster::PREFIX_VIRTUAL; 159 | 160 | $deliveryMode = new ConstStub($c->getDeliveryMode().(2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode()); 161 | 162 | // Recent version of the extension already expose private properties 163 | if (isset($a["\x00AMQPEnvelope\x00body"])) { 164 | $a["\0AMQPEnvelope\0delivery_mode"] = $deliveryMode; 165 | 166 | return $a; 167 | } 168 | 169 | if (!($filter & Caster::EXCLUDE_VERBOSE)) { 170 | $a += [$prefix.'body' => $c->getBody()]; 171 | } 172 | 173 | $a += [ 174 | $prefix.'delivery_tag' => $c->getDeliveryTag(), 175 | $prefix.'is_redelivery' => $c->isRedelivery(), 176 | $prefix.'exchange_name' => $c->getExchangeName(), 177 | $prefix.'routing_key' => $c->getRoutingKey(), 178 | $prefix.'content_type' => $c->getContentType(), 179 | $prefix.'content_encoding' => $c->getContentEncoding(), 180 | $prefix.'headers' => $c->getHeaders(), 181 | $prefix.'delivery_mode' => $deliveryMode, 182 | $prefix.'priority' => $c->getPriority(), 183 | $prefix.'correlation_id' => $c->getCorrelationId(), 184 | $prefix.'reply_to' => $c->getReplyTo(), 185 | $prefix.'expiration' => $c->getExpiration(), 186 | $prefix.'message_id' => $c->getMessageId(), 187 | $prefix.'timestamp' => $c->getTimeStamp(), 188 | $prefix.'type' => $c->getType(), 189 | $prefix.'user_id' => $c->getUserId(), 190 | $prefix.'app_id' => $c->getAppId(), 191 | ]; 192 | 193 | return $a; 194 | } 195 | 196 | private static function extractFlags(int $flags): ConstStub 197 | { 198 | $flagsArray = []; 199 | 200 | foreach (self::FLAGS as $value => $name) { 201 | if ($flags & $value) { 202 | $flagsArray[] = $name; 203 | } 204 | } 205 | 206 | if (!$flagsArray) { 207 | $flagsArray = ['AMQP_NOPARAM']; 208 | } 209 | 210 | return new ConstStub(implode('|', $flagsArray), $flags); 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ArgsStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a list of function arguments. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ArgsStub extends EnumStub 22 | { 23 | private static $parameters = []; 24 | 25 | public function __construct(array $args, string $function, ?string $class) 26 | { 27 | [$variadic, $params] = self::getParameters($function, $class); 28 | 29 | $values = []; 30 | foreach ($args as $k => $v) { 31 | $values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v; 32 | } 33 | if (null === $params) { 34 | parent::__construct($values, false); 35 | 36 | return; 37 | } 38 | if (\count($values) < \count($params)) { 39 | $params = \array_slice($params, 0, \count($values)); 40 | } elseif (\count($values) > \count($params)) { 41 | $values[] = new EnumStub(array_splice($values, \count($params)), false); 42 | $params[] = $variadic; 43 | } 44 | if (['...'] === $params) { 45 | $this->dumpKeys = false; 46 | $this->value = $values[0]->value; 47 | } else { 48 | $this->value = array_combine($params, $values); 49 | } 50 | } 51 | 52 | private static function getParameters(string $function, ?string $class): array 53 | { 54 | if (isset(self::$parameters[$k = $class.'::'.$function])) { 55 | return self::$parameters[$k]; 56 | } 57 | 58 | try { 59 | $r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function); 60 | } catch (\ReflectionException $e) { 61 | return [null, null]; 62 | } 63 | 64 | $variadic = '...'; 65 | $params = []; 66 | foreach ($r->getParameters() as $v) { 67 | $k = '$'.$v->name; 68 | if ($v->isPassedByReference()) { 69 | $k = '&'.$k; 70 | } 71 | if ($v->isVariadic()) { 72 | $variadic .= $k; 73 | } else { 74 | $params[] = $k; 75 | } 76 | } 77 | 78 | return self::$parameters[$k] = [$variadic, $params]; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/Caster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Helper for filtering out properties in casters. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class Caster 24 | { 25 | public const EXCLUDE_VERBOSE = 1; 26 | public const EXCLUDE_VIRTUAL = 2; 27 | public const EXCLUDE_DYNAMIC = 4; 28 | public const EXCLUDE_PUBLIC = 8; 29 | public const EXCLUDE_PROTECTED = 16; 30 | public const EXCLUDE_PRIVATE = 32; 31 | public const EXCLUDE_NULL = 64; 32 | public const EXCLUDE_EMPTY = 128; 33 | public const EXCLUDE_NOT_IMPORTANT = 256; 34 | public const EXCLUDE_STRICT = 512; 35 | 36 | public const PREFIX_VIRTUAL = "\0~\0"; 37 | public const PREFIX_DYNAMIC = "\0+\0"; 38 | public const PREFIX_PROTECTED = "\0*\0"; 39 | 40 | /** 41 | * Casts objects to arrays and adds the dynamic property prefix. 42 | * 43 | * @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not 44 | * 45 | * @return array The array-cast of the object, with prefixed dynamic properties 46 | */ 47 | public static function castObject(object $obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array 48 | { 49 | if ($hasDebugInfo) { 50 | try { 51 | $debugInfo = $obj->__debugInfo(); 52 | } catch (\Exception $e) { 53 | // ignore failing __debugInfo() 54 | $hasDebugInfo = false; 55 | } 56 | } 57 | 58 | $a = $obj instanceof \Closure ? [] : (array) $obj; 59 | 60 | if ($obj instanceof \__PHP_Incomplete_Class) { 61 | return $a; 62 | } 63 | 64 | if ($a) { 65 | static $publicProperties = []; 66 | $debugClass = $debugClass ?? get_debug_type($obj); 67 | 68 | $i = 0; 69 | $prefixedKeys = []; 70 | foreach ($a as $k => $v) { 71 | if ("\0" !== ($k[0] ?? '')) { 72 | if (!isset($publicProperties[$class])) { 73 | foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) { 74 | $publicProperties[$class][$prop->name] = true; 75 | } 76 | } 77 | if (!isset($publicProperties[$class][$k])) { 78 | $prefixedKeys[$i] = self::PREFIX_DYNAMIC.$k; 79 | } 80 | } elseif ($debugClass !== $class && 1 === strpos($k, $class)) { 81 | $prefixedKeys[$i] = "\0".$debugClass.strrchr($k, "\0"); 82 | } 83 | ++$i; 84 | } 85 | if ($prefixedKeys) { 86 | $keys = array_keys($a); 87 | foreach ($prefixedKeys as $i => $k) { 88 | $keys[$i] = $k; 89 | } 90 | $a = array_combine($keys, $a); 91 | } 92 | } 93 | 94 | if ($hasDebugInfo && \is_array($debugInfo)) { 95 | foreach ($debugInfo as $k => $v) { 96 | if (!isset($k[0]) || "\0" !== $k[0]) { 97 | if (\array_key_exists(self::PREFIX_DYNAMIC.$k, $a)) { 98 | continue; 99 | } 100 | $k = self::PREFIX_VIRTUAL.$k; 101 | } 102 | 103 | unset($a[$k]); 104 | $a[$k] = $v; 105 | } 106 | } 107 | 108 | return $a; 109 | } 110 | 111 | /** 112 | * Filters out the specified properties. 113 | * 114 | * By default, a single match in the $filter bit field filters properties out, following an "or" logic. 115 | * When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed. 116 | * 117 | * @param array $a The array containing the properties to filter 118 | * @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out 119 | * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set 120 | * @param int &$count Set to the number of removed properties 121 | * 122 | * @return array The filtered array 123 | */ 124 | public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array 125 | { 126 | $count = 0; 127 | 128 | foreach ($a as $k => $v) { 129 | $type = self::EXCLUDE_STRICT & $filter; 130 | 131 | if (null === $v) { 132 | $type |= self::EXCLUDE_NULL & $filter; 133 | $type |= self::EXCLUDE_EMPTY & $filter; 134 | } elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || [] === $v) { 135 | $type |= self::EXCLUDE_EMPTY & $filter; 136 | } 137 | if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !\in_array($k, $listedProperties, true)) { 138 | $type |= self::EXCLUDE_NOT_IMPORTANT; 139 | } 140 | if ((self::EXCLUDE_VERBOSE & $filter) && \in_array($k, $listedProperties, true)) { 141 | $type |= self::EXCLUDE_VERBOSE; 142 | } 143 | 144 | if (!isset($k[1]) || "\0" !== $k[0]) { 145 | $type |= self::EXCLUDE_PUBLIC & $filter; 146 | } elseif ('~' === $k[1]) { 147 | $type |= self::EXCLUDE_VIRTUAL & $filter; 148 | } elseif ('+' === $k[1]) { 149 | $type |= self::EXCLUDE_DYNAMIC & $filter; 150 | } elseif ('*' === $k[1]) { 151 | $type |= self::EXCLUDE_PROTECTED & $filter; 152 | } else { 153 | $type |= self::EXCLUDE_PRIVATE & $filter; 154 | } 155 | 156 | if ((self::EXCLUDE_STRICT & $filter) ? $type === $filter : $type) { 157 | unset($a[$k]); 158 | ++$count; 159 | } 160 | } 161 | 162 | return $a; 163 | } 164 | 165 | public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, bool $isNested): array 166 | { 167 | if (isset($a['__PHP_Incomplete_Class_Name'])) { 168 | $stub->class .= '('.$a['__PHP_Incomplete_Class_Name'].')'; 169 | unset($a['__PHP_Incomplete_Class_Name']); 170 | } 171 | 172 | return $a; 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ClassStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a PHP class identifier. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ClassStub extends ConstStub 22 | { 23 | /** 24 | * @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name 25 | * @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier 26 | */ 27 | public function __construct(string $identifier, $callable = null) 28 | { 29 | $this->value = $identifier; 30 | 31 | try { 32 | if (null !== $callable) { 33 | if ($callable instanceof \Closure) { 34 | $r = new \ReflectionFunction($callable); 35 | } elseif (\is_object($callable)) { 36 | $r = [$callable, '__invoke']; 37 | } elseif (\is_array($callable)) { 38 | $r = $callable; 39 | } elseif (false !== $i = strpos($callable, '::')) { 40 | $r = [substr($callable, 0, $i), substr($callable, 2 + $i)]; 41 | } else { 42 | $r = new \ReflectionFunction($callable); 43 | } 44 | } elseif (0 < $i = strpos($identifier, '::') ?: strpos($identifier, '->')) { 45 | $r = [substr($identifier, 0, $i), substr($identifier, 2 + $i)]; 46 | } else { 47 | $r = new \ReflectionClass($identifier); 48 | } 49 | 50 | if (\is_array($r)) { 51 | try { 52 | $r = new \ReflectionMethod($r[0], $r[1]); 53 | } catch (\ReflectionException $e) { 54 | $r = new \ReflectionClass($r[0]); 55 | } 56 | } 57 | 58 | if (str_contains($identifier, "@anonymous\0")) { 59 | $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) { 60 | return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; 61 | }, $identifier); 62 | } 63 | 64 | if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) { 65 | $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true, Caster::EXCLUDE_VERBOSE); 66 | $s = ReflectionCaster::getSignature($s); 67 | 68 | if (str_ends_with($identifier, '()')) { 69 | $this->value = substr_replace($identifier, $s, -2); 70 | } else { 71 | $this->value .= $s; 72 | } 73 | } 74 | } catch (\ReflectionException $e) { 75 | return; 76 | } finally { 77 | if (0 < $i = strrpos($this->value, '\\')) { 78 | $this->attr['ellipsis'] = \strlen($this->value) - $i; 79 | $this->attr['ellipsis-type'] = 'class'; 80 | $this->attr['ellipsis-tail'] = 1; 81 | } 82 | } 83 | 84 | if ($f = $r->getFileName()) { 85 | $this->attr['file'] = $f; 86 | $this->attr['line'] = $r->getStartLine(); 87 | } 88 | } 89 | 90 | public static function wrapCallable($callable) 91 | { 92 | if (\is_object($callable) || !\is_callable($callable)) { 93 | return $callable; 94 | } 95 | 96 | if (!\is_array($callable)) { 97 | $callable = new static($callable, $callable); 98 | } elseif (\is_string($callable[0])) { 99 | $callable[0] = new static($callable[0], $callable); 100 | } else { 101 | $callable[1] = new static($callable[1], $callable); 102 | } 103 | 104 | return $callable; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ConstStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a PHP constant and its value. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ConstStub extends Stub 22 | { 23 | public function __construct(string $name, $value = null) 24 | { 25 | $this->class = $name; 26 | $this->value = 1 < \func_num_args() ? $value : $name; 27 | } 28 | 29 | /** 30 | * @return string 31 | */ 32 | public function __toString() 33 | { 34 | return (string) $this->value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/CutArrayStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a cut array. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class CutArrayStub extends CutStub 20 | { 21 | public $preservedSubset; 22 | 23 | public function __construct(array $value, array $preservedKeys) 24 | { 25 | parent::__construct($value); 26 | 27 | $this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys)); 28 | $this->cut -= \count($this->preservedSubset); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/CutStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents the main properties of a PHP variable, pre-casted by a caster. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class CutStub extends Stub 22 | { 23 | public function __construct($value) 24 | { 25 | $this->value = $value; 26 | 27 | switch (\gettype($value)) { 28 | case 'object': 29 | $this->type = self::TYPE_OBJECT; 30 | $this->class = \get_class($value); 31 | 32 | if ($value instanceof \Closure) { 33 | ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE); 34 | } 35 | 36 | $this->cut = -1; 37 | break; 38 | 39 | case 'array': 40 | $this->type = self::TYPE_ARRAY; 41 | $this->class = self::ARRAY_ASSOC; 42 | $this->cut = $this->value = \count($value); 43 | break; 44 | 45 | case 'resource': 46 | case 'unknown type': 47 | case 'resource (closed)': 48 | $this->type = self::TYPE_RESOURCE; 49 | $this->handle = (int) $value; 50 | if ('Unknown' === $this->class = @get_resource_type($value)) { 51 | $this->class = 'Closed'; 52 | } 53 | $this->cut = -1; 54 | break; 55 | 56 | case 'string': 57 | $this->type = self::TYPE_STRING; 58 | $this->class = preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY; 59 | $this->cut = self::STRING_BINARY === $this->class ? \strlen($value) : mb_strlen($value, 'UTF-8'); 60 | $this->value = ''; 61 | break; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DateCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts DateTimeInterface related classes to array representation. 18 | * 19 | * @author Dany Maillard 20 | * 21 | * @final 22 | */ 23 | class DateCaster 24 | { 25 | private const PERIOD_LIMIT = 3; 26 | 27 | public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter) 28 | { 29 | $prefix = Caster::PREFIX_VIRTUAL; 30 | $location = $d->getTimezone()->getLocation(); 31 | $fromNow = (new \DateTime())->diff($d); 32 | 33 | $title = $d->format('l, F j, Y') 34 | ."\n".self::formatInterval($fromNow).' from now' 35 | .($location ? ($d->format('I') ? "\nDST On" : "\nDST Off") : '') 36 | ; 37 | 38 | unset( 39 | $a[Caster::PREFIX_DYNAMIC.'date'], 40 | $a[Caster::PREFIX_DYNAMIC.'timezone'], 41 | $a[Caster::PREFIX_DYNAMIC.'timezone_type'] 42 | ); 43 | $a[$prefix.'date'] = new ConstStub(self::formatDateTime($d, $location ? ' e (P)' : ' P'), $title); 44 | 45 | $stub->class .= $d->format(' @U'); 46 | 47 | return $a; 48 | } 49 | 50 | public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter) 51 | { 52 | $now = new \DateTimeImmutable(); 53 | $numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp(); 54 | $title = number_format($numberOfSeconds, 0, '.', ' ').'s'; 55 | 56 | $i = [Caster::PREFIX_VIRTUAL.'interval' => new ConstStub(self::formatInterval($interval), $title)]; 57 | 58 | return $filter & Caster::EXCLUDE_VERBOSE ? $i : $i + $a; 59 | } 60 | 61 | private static function formatInterval(\DateInterval $i): string 62 | { 63 | $format = '%R '; 64 | 65 | if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) { 66 | $i = date_diff($d = new \DateTime(), date_add(clone $d, $i)); // recalculate carry over points 67 | $format .= 0 < $i->days ? '%ad ' : ''; 68 | } else { 69 | $format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : ''); 70 | } 71 | 72 | $format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : ''; 73 | $format = '%R ' === $format ? '0s' : $format; 74 | 75 | return $i->format(rtrim($format)); 76 | } 77 | 78 | public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, bool $isNested, int $filter) 79 | { 80 | $location = $timeZone->getLocation(); 81 | $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P'); 82 | $title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : ''; 83 | 84 | $z = [Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title)]; 85 | 86 | return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a; 87 | } 88 | 89 | public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, bool $isNested, int $filter) 90 | { 91 | $dates = []; 92 | foreach (clone $p as $i => $d) { 93 | if (self::PERIOD_LIMIT === $i) { 94 | $now = new \DateTimeImmutable('now', new \DateTimeZone('UTC')); 95 | $dates[] = sprintf('%s more', ($end = $p->getEndDate()) 96 | ? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u'))) 97 | : $p->recurrences - $i 98 | ); 99 | break; 100 | } 101 | $dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d)); 102 | } 103 | 104 | $period = sprintf( 105 | 'every %s, from %s (%s) %s', 106 | self::formatInterval($p->getDateInterval()), 107 | self::formatDateTime($p->getStartDate()), 108 | $p->include_start_date ? 'included' : 'excluded', 109 | ($end = $p->getEndDate()) ? 'to '.self::formatDateTime($end) : 'recurring '.$p->recurrences.' time/s' 110 | ); 111 | 112 | $p = [Caster::PREFIX_VIRTUAL.'period' => new ConstStub($period, implode("\n", $dates))]; 113 | 114 | return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a; 115 | } 116 | 117 | private static function formatDateTime(\DateTimeInterface $d, string $extra = ''): string 118 | { 119 | return $d->format('Y-m-d H:i:'.self::formatSeconds($d->format('s'), $d->format('u')).$extra); 120 | } 121 | 122 | private static function formatSeconds(string $s, string $us): string 123 | { 124 | return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us)); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DoctrineCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Doctrine\Common\Proxy\Proxy as CommonProxy; 15 | use Doctrine\ORM\PersistentCollection; 16 | use Doctrine\ORM\Proxy\Proxy as OrmProxy; 17 | use Symfony\Component\VarDumper\Cloner\Stub; 18 | 19 | /** 20 | * Casts Doctrine related classes to array representation. 21 | * 22 | * @author Nicolas Grekas 23 | * 24 | * @final 25 | */ 26 | class DoctrineCaster 27 | { 28 | public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested) 29 | { 30 | foreach (['__cloner__', '__initializer__'] as $k) { 31 | if (\array_key_exists($k, $a)) { 32 | unset($a[$k]); 33 | ++$stub->cut; 34 | } 35 | } 36 | 37 | return $a; 38 | } 39 | 40 | public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested) 41 | { 42 | foreach (['_entityPersister', '_identifier'] as $k) { 43 | if (\array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) { 44 | unset($a[$k]); 45 | ++$stub->cut; 46 | } 47 | } 48 | 49 | return $a; 50 | } 51 | 52 | public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested) 53 | { 54 | foreach (['snapshot', 'association', 'typeClass'] as $k) { 55 | if (\array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) { 56 | $a[$k] = new CutStub($a[$k]); 57 | } 58 | } 59 | 60 | return $a; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DsCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Ds\Collection; 15 | use Ds\Map; 16 | use Ds\Pair; 17 | use Symfony\Component\VarDumper\Cloner\Stub; 18 | 19 | /** 20 | * Casts Ds extension classes to array representation. 21 | * 22 | * @author Jáchym Toušek 23 | * 24 | * @final 25 | */ 26 | class DsCaster 27 | { 28 | public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested): array 29 | { 30 | $a[Caster::PREFIX_VIRTUAL.'count'] = $c->count(); 31 | $a[Caster::PREFIX_VIRTUAL.'capacity'] = $c->capacity(); 32 | 33 | if (!$c instanceof Map) { 34 | $a += $c->toArray(); 35 | } 36 | 37 | return $a; 38 | } 39 | 40 | public static function castMap(Map $c, array $a, Stub $stub, bool $isNested): array 41 | { 42 | foreach ($c as $k => $v) { 43 | $a[] = new DsPairStub($k, $v); 44 | } 45 | 46 | return $a; 47 | } 48 | 49 | public static function castPair(Pair $c, array $a, Stub $stub, bool $isNested): array 50 | { 51 | foreach ($c->toArray() as $k => $v) { 52 | $a[Caster::PREFIX_VIRTUAL.$k] = $v; 53 | } 54 | 55 | return $a; 56 | } 57 | 58 | public static function castPairStub(DsPairStub $c, array $a, Stub $stub, bool $isNested): array 59 | { 60 | if ($isNested) { 61 | $stub->class = Pair::class; 62 | $stub->value = null; 63 | $stub->handle = 0; 64 | 65 | $a = $c->value; 66 | } 67 | 68 | return $a; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DsPairStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * @author Nicolas Grekas 18 | */ 19 | class DsPairStub extends Stub 20 | { 21 | public function __construct($key, $value) 22 | { 23 | $this->value = [ 24 | Caster::PREFIX_VIRTUAL.'key' => $key, 25 | Caster::PREFIX_VIRTUAL.'value' => $value, 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/EnumStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents an enumeration of values. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class EnumStub extends Stub 22 | { 23 | public $dumpKeys = true; 24 | 25 | public function __construct(array $values, bool $dumpKeys = true) 26 | { 27 | $this->value = $values; 28 | $this->dumpKeys = $dumpKeys; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/FrameStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a single backtrace frame as returned by debug_backtrace() or Exception->getTrace(). 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class FrameStub extends EnumStub 20 | { 21 | public $keepArgs; 22 | public $inTraceStub; 23 | 24 | public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false) 25 | { 26 | $this->value = $frame; 27 | $this->keepArgs = $keepArgs; 28 | $this->inTraceStub = $inTraceStub; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/GmpCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts GMP objects to array representation. 18 | * 19 | * @author Hamza Amrouche 20 | * @author Nicolas Grekas 21 | * 22 | * @final 23 | */ 24 | class GmpCaster 25 | { 26 | public static function castGmp(\GMP $gmp, array $a, Stub $stub, bool $isNested, int $filter): array 27 | { 28 | $a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp)); 29 | 30 | return $a; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ImagineCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Imagine\Image\ImageInterface; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | /** 18 | * @author Grégoire Pineau 19 | */ 20 | final class ImagineCaster 21 | { 22 | public static function castImage(ImageInterface $c, array $a, Stub $stub, bool $isNested): array 23 | { 24 | $imgData = $c->get('png'); 25 | if (\strlen($imgData) > 1 * 1000 * 1000) { 26 | $a += [ 27 | Caster::PREFIX_VIRTUAL.'image' => new ConstStub($c->getSize()), 28 | ]; 29 | } else { 30 | $a += [ 31 | Caster::PREFIX_VIRTUAL.'image' => new ImgStub($imgData, 'image/png', $c->getSize()), 32 | ]; 33 | } 34 | 35 | return $a; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ImgStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * @author Grégoire Pineau 16 | */ 17 | class ImgStub extends ConstStub 18 | { 19 | public function __construct(string $data, string $contentType, string $size = '') 20 | { 21 | $this->value = ''; 22 | $this->attr['img-data'] = $data; 23 | $this->attr['img-size'] = $size; 24 | $this->attr['content-type'] = $contentType; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/LinkStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a file or a URL. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class LinkStub extends ConstStub 20 | { 21 | public $inVendor = false; 22 | 23 | private static $vendorRoots; 24 | private static $composerRoots; 25 | 26 | public function __construct(string $label, int $line = 0, string $href = null) 27 | { 28 | $this->value = $label; 29 | 30 | if (null === $href) { 31 | $href = $label; 32 | } 33 | if (!\is_string($href)) { 34 | return; 35 | } 36 | if (str_starts_with($href, 'file://')) { 37 | if ($href === $label) { 38 | $label = substr($label, 7); 39 | } 40 | $href = substr($href, 7); 41 | } elseif (str_contains($href, '://')) { 42 | $this->attr['href'] = $href; 43 | 44 | return; 45 | } 46 | if (!is_file($href)) { 47 | return; 48 | } 49 | if ($line) { 50 | $this->attr['line'] = $line; 51 | } 52 | if ($label !== $this->attr['file'] = realpath($href) ?: $href) { 53 | return; 54 | } 55 | if ($composerRoot = $this->getComposerRoot($href, $this->inVendor)) { 56 | $this->attr['ellipsis'] = \strlen($href) - \strlen($composerRoot) + 1; 57 | $this->attr['ellipsis-type'] = 'path'; 58 | $this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + \strlen(implode('', \array_slice(explode(\DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0); 59 | } elseif (3 < \count($ellipsis = explode(\DIRECTORY_SEPARATOR, $href))) { 60 | $this->attr['ellipsis'] = 2 + \strlen(implode('', \array_slice($ellipsis, -2))); 61 | $this->attr['ellipsis-type'] = 'path'; 62 | $this->attr['ellipsis-tail'] = 1; 63 | } 64 | } 65 | 66 | private function getComposerRoot(string $file, bool &$inVendor) 67 | { 68 | if (null === self::$vendorRoots) { 69 | self::$vendorRoots = []; 70 | 71 | foreach (get_declared_classes() as $class) { 72 | if ('C' === $class[0] && str_starts_with($class, 'ComposerAutoloaderInit')) { 73 | $r = new \ReflectionClass($class); 74 | $v = \dirname($r->getFileName(), 2); 75 | if (is_file($v.'/composer/installed.json')) { 76 | self::$vendorRoots[] = $v.\DIRECTORY_SEPARATOR; 77 | } 78 | } 79 | } 80 | } 81 | $inVendor = false; 82 | 83 | if (isset(self::$composerRoots[$dir = \dirname($file)])) { 84 | return self::$composerRoots[$dir]; 85 | } 86 | 87 | foreach (self::$vendorRoots as $root) { 88 | if ($inVendor = str_starts_with($file, $root)) { 89 | return $root; 90 | } 91 | } 92 | 93 | $parent = $dir; 94 | while (!@is_file($parent.'/composer.json')) { 95 | if (!@file_exists($parent)) { 96 | // open_basedir restriction in effect 97 | break; 98 | } 99 | if ($parent === \dirname($parent)) { 100 | return self::$composerRoots[$dir] = false; 101 | } 102 | 103 | $parent = \dirname($parent); 104 | } 105 | 106 | return self::$composerRoots[$dir] = $parent.\DIRECTORY_SEPARATOR; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/MemcachedCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * @author Jan Schädlich 18 | * 19 | * @final 20 | */ 21 | class MemcachedCaster 22 | { 23 | private static $optionConstants; 24 | private static $defaultOptions; 25 | 26 | public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested) 27 | { 28 | $a += [ 29 | Caster::PREFIX_VIRTUAL.'servers' => $c->getServerList(), 30 | Caster::PREFIX_VIRTUAL.'options' => new EnumStub( 31 | self::getNonDefaultOptions($c) 32 | ), 33 | ]; 34 | 35 | return $a; 36 | } 37 | 38 | private static function getNonDefaultOptions(\Memcached $c): array 39 | { 40 | self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions(); 41 | self::$optionConstants = self::$optionConstants ?? self::getOptionConstants(); 42 | 43 | $nonDefaultOptions = []; 44 | foreach (self::$optionConstants as $constantKey => $value) { 45 | if (self::$defaultOptions[$constantKey] !== $option = $c->getOption($value)) { 46 | $nonDefaultOptions[$constantKey] = $option; 47 | } 48 | } 49 | 50 | return $nonDefaultOptions; 51 | } 52 | 53 | private static function discoverDefaultOptions(): array 54 | { 55 | $defaultMemcached = new \Memcached(); 56 | $defaultMemcached->addServer('127.0.0.1', 11211); 57 | 58 | $defaultOptions = []; 59 | self::$optionConstants = self::$optionConstants ?? self::getOptionConstants(); 60 | 61 | foreach (self::$optionConstants as $constantKey => $value) { 62 | $defaultOptions[$constantKey] = $defaultMemcached->getOption($value); 63 | } 64 | 65 | return $defaultOptions; 66 | } 67 | 68 | private static function getOptionConstants(): array 69 | { 70 | $reflectedMemcached = new \ReflectionClass(\Memcached::class); 71 | 72 | $optionConstants = []; 73 | foreach ($reflectedMemcached->getConstants() as $constantKey => $value) { 74 | if (str_starts_with($constantKey, 'OPT_')) { 75 | $optionConstants[$constantKey] = $value; 76 | } 77 | } 78 | 79 | return $optionConstants; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/PdoCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts PDO related classes to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class PdoCaster 24 | { 25 | private const PDO_ATTRIBUTES = [ 26 | 'CASE' => [ 27 | \PDO::CASE_LOWER => 'LOWER', 28 | \PDO::CASE_NATURAL => 'NATURAL', 29 | \PDO::CASE_UPPER => 'UPPER', 30 | ], 31 | 'ERRMODE' => [ 32 | \PDO::ERRMODE_SILENT => 'SILENT', 33 | \PDO::ERRMODE_WARNING => 'WARNING', 34 | \PDO::ERRMODE_EXCEPTION => 'EXCEPTION', 35 | ], 36 | 'TIMEOUT', 37 | 'PREFETCH', 38 | 'AUTOCOMMIT', 39 | 'PERSISTENT', 40 | 'DRIVER_NAME', 41 | 'SERVER_INFO', 42 | 'ORACLE_NULLS' => [ 43 | \PDO::NULL_NATURAL => 'NATURAL', 44 | \PDO::NULL_EMPTY_STRING => 'EMPTY_STRING', 45 | \PDO::NULL_TO_STRING => 'TO_STRING', 46 | ], 47 | 'CLIENT_VERSION', 48 | 'SERVER_VERSION', 49 | 'STATEMENT_CLASS', 50 | 'EMULATE_PREPARES', 51 | 'CONNECTION_STATUS', 52 | 'STRINGIFY_FETCHES', 53 | 'DEFAULT_FETCH_MODE' => [ 54 | \PDO::FETCH_ASSOC => 'ASSOC', 55 | \PDO::FETCH_BOTH => 'BOTH', 56 | \PDO::FETCH_LAZY => 'LAZY', 57 | \PDO::FETCH_NUM => 'NUM', 58 | \PDO::FETCH_OBJ => 'OBJ', 59 | ], 60 | ]; 61 | 62 | public static function castPdo(\PDO $c, array $a, Stub $stub, bool $isNested) 63 | { 64 | $attr = []; 65 | $errmode = $c->getAttribute(\PDO::ATTR_ERRMODE); 66 | $c->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); 67 | 68 | foreach (self::PDO_ATTRIBUTES as $k => $v) { 69 | if (!isset($k[0])) { 70 | $k = $v; 71 | $v = []; 72 | } 73 | 74 | try { 75 | $attr[$k] = 'ERRMODE' === $k ? $errmode : $c->getAttribute(\constant('PDO::ATTR_'.$k)); 76 | if ($v && isset($v[$attr[$k]])) { 77 | $attr[$k] = new ConstStub($v[$attr[$k]], $attr[$k]); 78 | } 79 | } catch (\Exception $e) { 80 | } 81 | } 82 | if (isset($attr[$k = 'STATEMENT_CLASS'][1])) { 83 | if ($attr[$k][1]) { 84 | $attr[$k][1] = new ArgsStub($attr[$k][1], '__construct', $attr[$k][0]); 85 | } 86 | $attr[$k][0] = new ClassStub($attr[$k][0]); 87 | } 88 | 89 | $prefix = Caster::PREFIX_VIRTUAL; 90 | $a += [ 91 | $prefix.'inTransaction' => method_exists($c, 'inTransaction'), 92 | $prefix.'errorInfo' => $c->errorInfo(), 93 | $prefix.'attributes' => new EnumStub($attr), 94 | ]; 95 | 96 | if ($a[$prefix.'inTransaction']) { 97 | $a[$prefix.'inTransaction'] = $c->inTransaction(); 98 | } else { 99 | unset($a[$prefix.'inTransaction']); 100 | } 101 | 102 | if (!isset($a[$prefix.'errorInfo'][1], $a[$prefix.'errorInfo'][2])) { 103 | unset($a[$prefix.'errorInfo']); 104 | } 105 | 106 | $c->setAttribute(\PDO::ATTR_ERRMODE, $errmode); 107 | 108 | return $a; 109 | } 110 | 111 | public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, bool $isNested) 112 | { 113 | $prefix = Caster::PREFIX_VIRTUAL; 114 | $a[$prefix.'errorInfo'] = $c->errorInfo(); 115 | 116 | if (!isset($a[$prefix.'errorInfo'][1], $a[$prefix.'errorInfo'][2])) { 117 | unset($a[$prefix.'errorInfo']); 118 | } 119 | 120 | return $a; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/PgSqlCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts pqsql resources to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class PgSqlCaster 24 | { 25 | private const PARAM_CODES = [ 26 | 'server_encoding', 27 | 'client_encoding', 28 | 'is_superuser', 29 | 'session_authorization', 30 | 'DateStyle', 31 | 'TimeZone', 32 | 'IntervalStyle', 33 | 'integer_datetimes', 34 | 'application_name', 35 | 'standard_conforming_strings', 36 | ]; 37 | 38 | private const TRANSACTION_STATUS = [ 39 | \PGSQL_TRANSACTION_IDLE => 'PGSQL_TRANSACTION_IDLE', 40 | \PGSQL_TRANSACTION_ACTIVE => 'PGSQL_TRANSACTION_ACTIVE', 41 | \PGSQL_TRANSACTION_INTRANS => 'PGSQL_TRANSACTION_INTRANS', 42 | \PGSQL_TRANSACTION_INERROR => 'PGSQL_TRANSACTION_INERROR', 43 | \PGSQL_TRANSACTION_UNKNOWN => 'PGSQL_TRANSACTION_UNKNOWN', 44 | ]; 45 | 46 | private const RESULT_STATUS = [ 47 | \PGSQL_EMPTY_QUERY => 'PGSQL_EMPTY_QUERY', 48 | \PGSQL_COMMAND_OK => 'PGSQL_COMMAND_OK', 49 | \PGSQL_TUPLES_OK => 'PGSQL_TUPLES_OK', 50 | \PGSQL_COPY_OUT => 'PGSQL_COPY_OUT', 51 | \PGSQL_COPY_IN => 'PGSQL_COPY_IN', 52 | \PGSQL_BAD_RESPONSE => 'PGSQL_BAD_RESPONSE', 53 | \PGSQL_NONFATAL_ERROR => 'PGSQL_NONFATAL_ERROR', 54 | \PGSQL_FATAL_ERROR => 'PGSQL_FATAL_ERROR', 55 | ]; 56 | 57 | private const DIAG_CODES = [ 58 | 'severity' => \PGSQL_DIAG_SEVERITY, 59 | 'sqlstate' => \PGSQL_DIAG_SQLSTATE, 60 | 'message' => \PGSQL_DIAG_MESSAGE_PRIMARY, 61 | 'detail' => \PGSQL_DIAG_MESSAGE_DETAIL, 62 | 'hint' => \PGSQL_DIAG_MESSAGE_HINT, 63 | 'statement position' => \PGSQL_DIAG_STATEMENT_POSITION, 64 | 'internal position' => \PGSQL_DIAG_INTERNAL_POSITION, 65 | 'internal query' => \PGSQL_DIAG_INTERNAL_QUERY, 66 | 'context' => \PGSQL_DIAG_CONTEXT, 67 | 'file' => \PGSQL_DIAG_SOURCE_FILE, 68 | 'line' => \PGSQL_DIAG_SOURCE_LINE, 69 | 'function' => \PGSQL_DIAG_SOURCE_FUNCTION, 70 | ]; 71 | 72 | public static function castLargeObject($lo, array $a, Stub $stub, bool $isNested) 73 | { 74 | $a['seek position'] = pg_lo_tell($lo); 75 | 76 | return $a; 77 | } 78 | 79 | public static function castLink($link, array $a, Stub $stub, bool $isNested) 80 | { 81 | $a['status'] = pg_connection_status($link); 82 | $a['status'] = new ConstStub(\PGSQL_CONNECTION_OK === $a['status'] ? 'PGSQL_CONNECTION_OK' : 'PGSQL_CONNECTION_BAD', $a['status']); 83 | $a['busy'] = pg_connection_busy($link); 84 | 85 | $a['transaction'] = pg_transaction_status($link); 86 | if (isset(self::TRANSACTION_STATUS[$a['transaction']])) { 87 | $a['transaction'] = new ConstStub(self::TRANSACTION_STATUS[$a['transaction']], $a['transaction']); 88 | } 89 | 90 | $a['pid'] = pg_get_pid($link); 91 | $a['last error'] = pg_last_error($link); 92 | $a['last notice'] = pg_last_notice($link); 93 | $a['host'] = pg_host($link); 94 | $a['port'] = pg_port($link); 95 | $a['dbname'] = pg_dbname($link); 96 | $a['options'] = pg_options($link); 97 | $a['version'] = pg_version($link); 98 | 99 | foreach (self::PARAM_CODES as $v) { 100 | if (false !== $s = pg_parameter_status($link, $v)) { 101 | $a['param'][$v] = $s; 102 | } 103 | } 104 | 105 | $a['param']['client_encoding'] = pg_client_encoding($link); 106 | $a['param'] = new EnumStub($a['param']); 107 | 108 | return $a; 109 | } 110 | 111 | public static function castResult($result, array $a, Stub $stub, bool $isNested) 112 | { 113 | $a['num rows'] = pg_num_rows($result); 114 | $a['status'] = pg_result_status($result); 115 | if (isset(self::RESULT_STATUS[$a['status']])) { 116 | $a['status'] = new ConstStub(self::RESULT_STATUS[$a['status']], $a['status']); 117 | } 118 | $a['command-completion tag'] = pg_result_status($result, \PGSQL_STATUS_STRING); 119 | 120 | if (-1 === $a['num rows']) { 121 | foreach (self::DIAG_CODES as $k => $v) { 122 | $a['error'][$k] = pg_result_error_field($result, $v); 123 | } 124 | } 125 | 126 | $a['affected rows'] = pg_affected_rows($result); 127 | $a['last OID'] = pg_last_oid($result); 128 | 129 | $fields = pg_num_fields($result); 130 | 131 | for ($i = 0; $i < $fields; ++$i) { 132 | $field = [ 133 | 'name' => pg_field_name($result, $i), 134 | 'table' => sprintf('%s (OID: %s)', pg_field_table($result, $i), pg_field_table($result, $i, true)), 135 | 'type' => sprintf('%s (OID: %s)', pg_field_type($result, $i), pg_field_type_oid($result, $i)), 136 | 'nullable' => (bool) pg_field_is_null($result, $i), 137 | 'storage' => pg_field_size($result, $i).' bytes', 138 | 'display' => pg_field_prtlen($result, $i).' chars', 139 | ]; 140 | if (' (OID: )' === $field['table']) { 141 | $field['table'] = null; 142 | } 143 | if ('-1 bytes' === $field['storage']) { 144 | $field['storage'] = 'variable size'; 145 | } elseif ('1 bytes' === $field['storage']) { 146 | $field['storage'] = '1 byte'; 147 | } 148 | if ('1 chars' === $field['display']) { 149 | $field['display'] = '1 char'; 150 | } 151 | $a['fields'][] = new EnumStub($field); 152 | } 153 | 154 | return $a; 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use ProxyManager\Proxy\ProxyInterface; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | /** 18 | * @author Nicolas Grekas 19 | * 20 | * @final 21 | */ 22 | class ProxyManagerCaster 23 | { 24 | public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested) 25 | { 26 | if ($parent = get_parent_class($c)) { 27 | $stub->class .= ' - '.$parent; 28 | } 29 | $stub->class .= '@proxy'; 30 | 31 | return $a; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/RdKafkaCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use RdKafka\Conf; 15 | use RdKafka\Exception as RdKafkaException; 16 | use RdKafka\KafkaConsumer; 17 | use RdKafka\Message; 18 | use RdKafka\Metadata\Broker as BrokerMetadata; 19 | use RdKafka\Metadata\Collection as CollectionMetadata; 20 | use RdKafka\Metadata\Partition as PartitionMetadata; 21 | use RdKafka\Metadata\Topic as TopicMetadata; 22 | use RdKafka\Topic; 23 | use RdKafka\TopicConf; 24 | use RdKafka\TopicPartition; 25 | use Symfony\Component\VarDumper\Cloner\Stub; 26 | 27 | /** 28 | * Casts RdKafka related classes to array representation. 29 | * 30 | * @author Romain Neutron 31 | */ 32 | class RdKafkaCaster 33 | { 34 | public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, bool $isNested) 35 | { 36 | $prefix = Caster::PREFIX_VIRTUAL; 37 | 38 | try { 39 | $assignment = $c->getAssignment(); 40 | } catch (RdKafkaException $e) { 41 | $assignment = []; 42 | } 43 | 44 | $a += [ 45 | $prefix.'subscription' => $c->getSubscription(), 46 | $prefix.'assignment' => $assignment, 47 | ]; 48 | 49 | $a += self::extractMetadata($c); 50 | 51 | return $a; 52 | } 53 | 54 | public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested) 55 | { 56 | $prefix = Caster::PREFIX_VIRTUAL; 57 | 58 | $a += [ 59 | $prefix.'name' => $c->getName(), 60 | ]; 61 | 62 | return $a; 63 | } 64 | 65 | public static function castTopicPartition(TopicPartition $c, array $a) 66 | { 67 | $prefix = Caster::PREFIX_VIRTUAL; 68 | 69 | $a += [ 70 | $prefix.'offset' => $c->getOffset(), 71 | $prefix.'partition' => $c->getPartition(), 72 | $prefix.'topic' => $c->getTopic(), 73 | ]; 74 | 75 | return $a; 76 | } 77 | 78 | public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested) 79 | { 80 | $prefix = Caster::PREFIX_VIRTUAL; 81 | 82 | $a += [ 83 | $prefix.'errstr' => $c->errstr(), 84 | ]; 85 | 86 | return $a; 87 | } 88 | 89 | public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested) 90 | { 91 | $prefix = Caster::PREFIX_VIRTUAL; 92 | 93 | foreach ($c->dump() as $key => $value) { 94 | $a[$prefix.$key] = $value; 95 | } 96 | 97 | return $a; 98 | } 99 | 100 | public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $isNested) 101 | { 102 | $prefix = Caster::PREFIX_VIRTUAL; 103 | 104 | foreach ($c->dump() as $key => $value) { 105 | $a[$prefix.$key] = $value; 106 | } 107 | 108 | return $a; 109 | } 110 | 111 | public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNested) 112 | { 113 | $prefix = Caster::PREFIX_VIRTUAL; 114 | 115 | $a += [ 116 | $prefix.'out_q_len' => $c->getOutQLen(), 117 | ]; 118 | 119 | $a += self::extractMetadata($c); 120 | 121 | return $a; 122 | } 123 | 124 | public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, bool $isNested) 125 | { 126 | $a += iterator_to_array($c); 127 | 128 | return $a; 129 | } 130 | 131 | public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, bool $isNested) 132 | { 133 | $prefix = Caster::PREFIX_VIRTUAL; 134 | 135 | $a += [ 136 | $prefix.'name' => $c->getTopic(), 137 | $prefix.'partitions' => $c->getPartitions(), 138 | ]; 139 | 140 | return $a; 141 | } 142 | 143 | public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, bool $isNested) 144 | { 145 | $prefix = Caster::PREFIX_VIRTUAL; 146 | 147 | $a += [ 148 | $prefix.'id' => $c->getId(), 149 | $prefix.'err' => $c->getErr(), 150 | $prefix.'leader' => $c->getLeader(), 151 | ]; 152 | 153 | return $a; 154 | } 155 | 156 | public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, bool $isNested) 157 | { 158 | $prefix = Caster::PREFIX_VIRTUAL; 159 | 160 | $a += [ 161 | $prefix.'id' => $c->getId(), 162 | $prefix.'host' => $c->getHost(), 163 | $prefix.'port' => $c->getPort(), 164 | ]; 165 | 166 | return $a; 167 | } 168 | 169 | private static function extractMetadata($c) 170 | { 171 | $prefix = Caster::PREFIX_VIRTUAL; 172 | 173 | try { 174 | $m = $c->getMetadata(true, null, 500); 175 | } catch (RdKafkaException $e) { 176 | return []; 177 | } 178 | 179 | return [ 180 | $prefix.'orig_broker_id' => $m->getOrigBrokerId(), 181 | $prefix.'orig_broker_name' => $m->getOrigBrokerName(), 182 | $prefix.'brokers' => $m->getBrokers(), 183 | $prefix.'topics' => $m->getTopics(), 184 | ]; 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/RedisCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts Redis class from ext-redis to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class RedisCaster 24 | { 25 | private const SERIALIZERS = [ 26 | \Redis::SERIALIZER_NONE => 'NONE', 27 | \Redis::SERIALIZER_PHP => 'PHP', 28 | 2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY 29 | ]; 30 | 31 | private const MODES = [ 32 | \Redis::ATOMIC => 'ATOMIC', 33 | \Redis::MULTI => 'MULTI', 34 | \Redis::PIPELINE => 'PIPELINE', 35 | ]; 36 | 37 | private const COMPRESSION_MODES = [ 38 | 0 => 'NONE', // Redis::COMPRESSION_NONE 39 | 1 => 'LZF', // Redis::COMPRESSION_LZF 40 | ]; 41 | 42 | private const FAILOVER_OPTIONS = [ 43 | \RedisCluster::FAILOVER_NONE => 'NONE', 44 | \RedisCluster::FAILOVER_ERROR => 'ERROR', 45 | \RedisCluster::FAILOVER_DISTRIBUTE => 'DISTRIBUTE', 46 | \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES', 47 | ]; 48 | 49 | public static function castRedis(\Redis $c, array $a, Stub $stub, bool $isNested) 50 | { 51 | $prefix = Caster::PREFIX_VIRTUAL; 52 | 53 | if (!$connected = $c->isConnected()) { 54 | return $a + [ 55 | $prefix.'isConnected' => $connected, 56 | ]; 57 | } 58 | 59 | $mode = $c->getMode(); 60 | 61 | return $a + [ 62 | $prefix.'isConnected' => $connected, 63 | $prefix.'host' => $c->getHost(), 64 | $prefix.'port' => $c->getPort(), 65 | $prefix.'auth' => $c->getAuth(), 66 | $prefix.'mode' => isset(self::MODES[$mode]) ? new ConstStub(self::MODES[$mode], $mode) : $mode, 67 | $prefix.'dbNum' => $c->getDbNum(), 68 | $prefix.'timeout' => $c->getTimeout(), 69 | $prefix.'lastError' => $c->getLastError(), 70 | $prefix.'persistentId' => $c->getPersistentID(), 71 | $prefix.'options' => self::getRedisOptions($c), 72 | ]; 73 | } 74 | 75 | public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, bool $isNested) 76 | { 77 | $prefix = Caster::PREFIX_VIRTUAL; 78 | 79 | return $a + [ 80 | $prefix.'hosts' => $c->_hosts(), 81 | $prefix.'function' => ClassStub::wrapCallable($c->_function()), 82 | $prefix.'lastError' => $c->getLastError(), 83 | $prefix.'options' => self::getRedisOptions($c), 84 | ]; 85 | } 86 | 87 | public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, bool $isNested) 88 | { 89 | $prefix = Caster::PREFIX_VIRTUAL; 90 | $failover = $c->getOption(\RedisCluster::OPT_SLAVE_FAILOVER); 91 | 92 | $a += [ 93 | $prefix.'_masters' => $c->_masters(), 94 | $prefix.'_redir' => $c->_redir(), 95 | $prefix.'mode' => new ConstStub($c->getMode() ? 'MULTI' : 'ATOMIC', $c->getMode()), 96 | $prefix.'lastError' => $c->getLastError(), 97 | $prefix.'options' => self::getRedisOptions($c, [ 98 | 'SLAVE_FAILOVER' => isset(self::FAILOVER_OPTIONS[$failover]) ? new ConstStub(self::FAILOVER_OPTIONS[$failover], $failover) : $failover, 99 | ]), 100 | ]; 101 | 102 | return $a; 103 | } 104 | 105 | /** 106 | * @param \Redis|\RedisArray|\RedisCluster $redis 107 | */ 108 | private static function getRedisOptions($redis, array $options = []): EnumStub 109 | { 110 | $serializer = $redis->getOption(\Redis::OPT_SERIALIZER); 111 | if (\is_array($serializer)) { 112 | foreach ($serializer as &$v) { 113 | if (isset(self::SERIALIZERS[$v])) { 114 | $v = new ConstStub(self::SERIALIZERS[$v], $v); 115 | } 116 | } 117 | } elseif (isset(self::SERIALIZERS[$serializer])) { 118 | $serializer = new ConstStub(self::SERIALIZERS[$serializer], $serializer); 119 | } 120 | 121 | $compression = \defined('Redis::OPT_COMPRESSION') ? $redis->getOption(\Redis::OPT_COMPRESSION) : 0; 122 | if (\is_array($compression)) { 123 | foreach ($compression as &$v) { 124 | if (isset(self::COMPRESSION_MODES[$v])) { 125 | $v = new ConstStub(self::COMPRESSION_MODES[$v], $v); 126 | } 127 | } 128 | } elseif (isset(self::COMPRESSION_MODES[$compression])) { 129 | $compression = new ConstStub(self::COMPRESSION_MODES[$compression], $compression); 130 | } 131 | 132 | $retry = \defined('Redis::OPT_SCAN') ? $redis->getOption(\Redis::OPT_SCAN) : 0; 133 | if (\is_array($retry)) { 134 | foreach ($retry as &$v) { 135 | $v = new ConstStub($v ? 'RETRY' : 'NORETRY', $v); 136 | } 137 | } else { 138 | $retry = new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry); 139 | } 140 | 141 | $options += [ 142 | 'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : 0, 143 | 'READ_TIMEOUT' => $redis->getOption(\Redis::OPT_READ_TIMEOUT), 144 | 'COMPRESSION' => $compression, 145 | 'SERIALIZER' => $serializer, 146 | 'PREFIX' => $redis->getOption(\Redis::OPT_PREFIX), 147 | 'SCAN' => $retry, 148 | ]; 149 | 150 | return new EnumStub($options); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ResourceCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts common resource types to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class ResourceCaster 24 | { 25 | /** 26 | * @param \CurlHandle|resource $h 27 | * 28 | * @return array 29 | */ 30 | public static function castCurl($h, array $a, Stub $stub, bool $isNested) 31 | { 32 | return curl_getinfo($h); 33 | } 34 | 35 | public static function castDba($dba, array $a, Stub $stub, bool $isNested) 36 | { 37 | $list = dba_list(); 38 | $a['file'] = $list[(int) $dba]; 39 | 40 | return $a; 41 | } 42 | 43 | public static function castProcess($process, array $a, Stub $stub, bool $isNested) 44 | { 45 | return proc_get_status($process); 46 | } 47 | 48 | public static function castStream($stream, array $a, Stub $stub, bool $isNested) 49 | { 50 | $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); 51 | if ($a['uri'] ?? false) { 52 | $a['uri'] = new LinkStub($a['uri']); 53 | } 54 | 55 | return $a; 56 | } 57 | 58 | public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested) 59 | { 60 | return @stream_context_get_params($stream) ?: $a; 61 | } 62 | 63 | public static function castGd($gd, array $a, Stub $stub, bool $isNested) 64 | { 65 | $a['size'] = imagesx($gd).'x'.imagesy($gd); 66 | $a['trueColor'] = imageistruecolor($gd); 67 | 68 | return $a; 69 | } 70 | 71 | public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested) 72 | { 73 | $a['host'] = mysql_get_host_info($h); 74 | $a['protocol'] = mysql_get_proto_info($h); 75 | $a['server'] = mysql_get_server_info($h); 76 | 77 | return $a; 78 | } 79 | 80 | public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested) 81 | { 82 | $stub->cut = -1; 83 | $info = openssl_x509_parse($h, false); 84 | 85 | $pin = openssl_pkey_get_public($h); 86 | $pin = openssl_pkey_get_details($pin)['key']; 87 | $pin = \array_slice(explode("\n", $pin), 1, -2); 88 | $pin = base64_decode(implode('', $pin)); 89 | $pin = base64_encode(hash('sha256', $pin, true)); 90 | 91 | $a += [ 92 | 'subject' => new EnumStub(array_intersect_key($info['subject'], ['organizationName' => true, 'commonName' => true])), 93 | 'issuer' => new EnumStub(array_intersect_key($info['issuer'], ['organizationName' => true, 'commonName' => true])), 94 | 'expiry' => new ConstStub(date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']), 95 | 'fingerprint' => new EnumStub([ 96 | 'md5' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'md5')), 2, ':', true)), 97 | 'sha1' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha1')), 2, ':', true)), 98 | 'sha256' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha256')), 2, ':', true)), 99 | 'pin-sha256' => new ConstStub($pin), 100 | ]), 101 | ]; 102 | 103 | return $a; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/SplCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts SPL related classes to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class SplCaster 24 | { 25 | private const SPL_FILE_OBJECT_FLAGS = [ 26 | \SplFileObject::DROP_NEW_LINE => 'DROP_NEW_LINE', 27 | \SplFileObject::READ_AHEAD => 'READ_AHEAD', 28 | \SplFileObject::SKIP_EMPTY => 'SKIP_EMPTY', 29 | \SplFileObject::READ_CSV => 'READ_CSV', 30 | ]; 31 | 32 | public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, bool $isNested) 33 | { 34 | return self::castSplArray($c, $a, $stub, $isNested); 35 | } 36 | 37 | public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, bool $isNested) 38 | { 39 | return self::castSplArray($c, $a, $stub, $isNested); 40 | } 41 | 42 | public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNested) 43 | { 44 | $a += [ 45 | Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c), 46 | ]; 47 | 48 | return $a; 49 | } 50 | 51 | public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, bool $isNested) 52 | { 53 | $prefix = Caster::PREFIX_VIRTUAL; 54 | $mode = $c->getIteratorMode(); 55 | $c->setIteratorMode(\SplDoublyLinkedList::IT_MODE_KEEP | $mode & ~\SplDoublyLinkedList::IT_MODE_DELETE); 56 | 57 | $a += [ 58 | $prefix.'mode' => new ConstStub((($mode & \SplDoublyLinkedList::IT_MODE_LIFO) ? 'IT_MODE_LIFO' : 'IT_MODE_FIFO').' | '.(($mode & \SplDoublyLinkedList::IT_MODE_DELETE) ? 'IT_MODE_DELETE' : 'IT_MODE_KEEP'), $mode), 59 | $prefix.'dllist' => iterator_to_array($c), 60 | ]; 61 | $c->setIteratorMode($mode); 62 | 63 | return $a; 64 | } 65 | 66 | public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool $isNested) 67 | { 68 | static $map = [ 69 | 'path' => 'getPath', 70 | 'filename' => 'getFilename', 71 | 'basename' => 'getBasename', 72 | 'pathname' => 'getPathname', 73 | 'extension' => 'getExtension', 74 | 'realPath' => 'getRealPath', 75 | 'aTime' => 'getATime', 76 | 'mTime' => 'getMTime', 77 | 'cTime' => 'getCTime', 78 | 'inode' => 'getInode', 79 | 'size' => 'getSize', 80 | 'perms' => 'getPerms', 81 | 'owner' => 'getOwner', 82 | 'group' => 'getGroup', 83 | 'type' => 'getType', 84 | 'writable' => 'isWritable', 85 | 'readable' => 'isReadable', 86 | 'executable' => 'isExecutable', 87 | 'file' => 'isFile', 88 | 'dir' => 'isDir', 89 | 'link' => 'isLink', 90 | 'linkTarget' => 'getLinkTarget', 91 | ]; 92 | 93 | $prefix = Caster::PREFIX_VIRTUAL; 94 | unset($a["\0SplFileInfo\0fileName"]); 95 | unset($a["\0SplFileInfo\0pathName"]); 96 | 97 | if (\PHP_VERSION_ID < 80000) { 98 | if (false === $c->getPathname()) { 99 | $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; 100 | 101 | return $a; 102 | } 103 | } else { 104 | try { 105 | $c->isReadable(); 106 | } catch (\RuntimeException $e) { 107 | if ('Object not initialized' !== $e->getMessage()) { 108 | throw $e; 109 | } 110 | 111 | $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; 112 | 113 | return $a; 114 | } catch (\Error $e) { 115 | if ('Object not initialized' !== $e->getMessage()) { 116 | throw $e; 117 | } 118 | 119 | $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; 120 | 121 | return $a; 122 | } 123 | } 124 | 125 | foreach ($map as $key => $accessor) { 126 | try { 127 | $a[$prefix.$key] = $c->$accessor(); 128 | } catch (\Exception $e) { 129 | } 130 | } 131 | 132 | if ($a[$prefix.'realPath'] ?? false) { 133 | $a[$prefix.'realPath'] = new LinkStub($a[$prefix.'realPath']); 134 | } 135 | 136 | if (isset($a[$prefix.'perms'])) { 137 | $a[$prefix.'perms'] = new ConstStub(sprintf('0%o', $a[$prefix.'perms']), $a[$prefix.'perms']); 138 | } 139 | 140 | static $mapDate = ['aTime', 'mTime', 'cTime']; 141 | foreach ($mapDate as $key) { 142 | if (isset($a[$prefix.$key])) { 143 | $a[$prefix.$key] = new ConstStub(date('Y-m-d H:i:s', $a[$prefix.$key]), $a[$prefix.$key]); 144 | } 145 | } 146 | 147 | return $a; 148 | } 149 | 150 | public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, bool $isNested) 151 | { 152 | static $map = [ 153 | 'csvControl' => 'getCsvControl', 154 | 'flags' => 'getFlags', 155 | 'maxLineLen' => 'getMaxLineLen', 156 | 'fstat' => 'fstat', 157 | 'eof' => 'eof', 158 | 'key' => 'key', 159 | ]; 160 | 161 | $prefix = Caster::PREFIX_VIRTUAL; 162 | 163 | foreach ($map as $key => $accessor) { 164 | try { 165 | $a[$prefix.$key] = $c->$accessor(); 166 | } catch (\Exception $e) { 167 | } 168 | } 169 | 170 | if (isset($a[$prefix.'flags'])) { 171 | $flagsArray = []; 172 | foreach (self::SPL_FILE_OBJECT_FLAGS as $value => $name) { 173 | if ($a[$prefix.'flags'] & $value) { 174 | $flagsArray[] = $name; 175 | } 176 | } 177 | $a[$prefix.'flags'] = new ConstStub(implode('|', $flagsArray), $a[$prefix.'flags']); 178 | } 179 | 180 | if (isset($a[$prefix.'fstat'])) { 181 | $a[$prefix.'fstat'] = new CutArrayStub($a[$prefix.'fstat'], ['dev', 'ino', 'nlink', 'rdev', 'blksize', 'blocks']); 182 | } 183 | 184 | return $a; 185 | } 186 | 187 | public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, bool $isNested) 188 | { 189 | $storage = []; 190 | unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967 191 | unset($a["\0SplObjectStorage\0storage"]); 192 | 193 | $clone = clone $c; 194 | foreach ($clone as $obj) { 195 | $storage[] = [ 196 | 'object' => $obj, 197 | 'info' => $clone->getInfo(), 198 | ]; 199 | } 200 | 201 | $a += [ 202 | Caster::PREFIX_VIRTUAL.'storage' => $storage, 203 | ]; 204 | 205 | return $a; 206 | } 207 | 208 | public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, bool $isNested) 209 | { 210 | $a[Caster::PREFIX_VIRTUAL.'innerIterator'] = $c->getInnerIterator(); 211 | 212 | return $a; 213 | } 214 | 215 | public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, bool $isNested) 216 | { 217 | $a[Caster::PREFIX_VIRTUAL.'object'] = $c->get(); 218 | 219 | return $a; 220 | } 221 | 222 | private static function castSplArray($c, array $a, Stub $stub, bool $isNested): array 223 | { 224 | $prefix = Caster::PREFIX_VIRTUAL; 225 | $flags = $c->getFlags(); 226 | 227 | if (!($flags & \ArrayObject::STD_PROP_LIST)) { 228 | $c->setFlags(\ArrayObject::STD_PROP_LIST); 229 | $a = Caster::castObject($c, \get_class($c), method_exists($c, '__debugInfo'), $stub->class); 230 | $c->setFlags($flags); 231 | } 232 | if (\PHP_VERSION_ID < 70400) { 233 | $a[$prefix.'storage'] = $c->getArrayCopy(); 234 | } 235 | $a += [ 236 | $prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST), 237 | $prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS), 238 | ]; 239 | if ($c instanceof \ArrayObject) { 240 | $a[$prefix.'iteratorClass'] = new ClassStub($c->getIteratorClass()); 241 | } 242 | 243 | return $a; 244 | } 245 | } 246 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/StubCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts a caster's Stub. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class StubCaster 24 | { 25 | public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested) 26 | { 27 | if ($isNested) { 28 | $stub->type = $c->type; 29 | $stub->class = $c->class; 30 | $stub->value = $c->value; 31 | $stub->handle = $c->handle; 32 | $stub->cut = $c->cut; 33 | $stub->attr = $c->attr; 34 | 35 | if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !preg_match('//u', $c->value)) { 36 | $stub->type = Stub::TYPE_STRING; 37 | $stub->class = Stub::STRING_BINARY; 38 | } 39 | 40 | $a = []; 41 | } 42 | 43 | return $a; 44 | } 45 | 46 | public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested) 47 | { 48 | return $isNested ? $c->preservedSubset : $a; 49 | } 50 | 51 | public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) 52 | { 53 | if ($isNested) { 54 | $stub->cut += \count($a); 55 | 56 | return []; 57 | } 58 | 59 | return $a; 60 | } 61 | 62 | public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested) 63 | { 64 | if ($isNested) { 65 | $stub->class = $c->dumpKeys ? '' : null; 66 | $stub->handle = 0; 67 | $stub->value = null; 68 | $stub->cut = $c->cut; 69 | $stub->attr = $c->attr; 70 | 71 | $a = []; 72 | 73 | if ($c->value) { 74 | foreach (array_keys($c->value) as $k) { 75 | $keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k; 76 | } 77 | // Preserve references with array_combine() 78 | $a = array_combine($keys, $c->value); 79 | } 80 | } 81 | 82 | return $a; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/SymfonyCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\HttpFoundation\Request; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | /** 18 | * @final 19 | */ 20 | class SymfonyCaster 21 | { 22 | private const REQUEST_GETTERS = [ 23 | 'pathInfo' => 'getPathInfo', 24 | 'requestUri' => 'getRequestUri', 25 | 'baseUrl' => 'getBaseUrl', 26 | 'basePath' => 'getBasePath', 27 | 'method' => 'getMethod', 28 | 'format' => 'getRequestFormat', 29 | ]; 30 | 31 | public static function castRequest(Request $request, array $a, Stub $stub, bool $isNested) 32 | { 33 | $clone = null; 34 | 35 | foreach (self::REQUEST_GETTERS as $prop => $getter) { 36 | $key = Caster::PREFIX_PROTECTED.$prop; 37 | if (\array_key_exists($key, $a) && null === $a[$key]) { 38 | if (null === $clone) { 39 | $clone = clone $request; 40 | } 41 | $a[Caster::PREFIX_VIRTUAL.$prop] = $clone->{$getter}(); 42 | } 43 | } 44 | 45 | return $a; 46 | } 47 | 48 | public static function castHttpClient($client, array $a, Stub $stub, bool $isNested) 49 | { 50 | $multiKey = sprintf("\0%s\0multi", \get_class($client)); 51 | if (isset($a[$multiKey])) { 52 | $a[$multiKey] = new CutStub($a[$multiKey]); 53 | } 54 | 55 | return $a; 56 | } 57 | 58 | public static function castHttpClientResponse($response, array $a, Stub $stub, bool $isNested) 59 | { 60 | $stub->cut += \count($a); 61 | $a = []; 62 | 63 | foreach ($response->getInfo() as $k => $v) { 64 | $a[Caster::PREFIX_VIRTUAL.$k] = $v; 65 | } 66 | 67 | return $a; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/TraceStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a backtrace as returned by debug_backtrace() or Exception->getTrace(). 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class TraceStub extends Stub 22 | { 23 | public $keepArgs; 24 | public $sliceOffset; 25 | public $sliceLength; 26 | public $numberingOffset; 27 | 28 | public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) 29 | { 30 | $this->value = $trace; 31 | $this->keepArgs = $keepArgs; 32 | $this->sliceOffset = $sliceOffset; 33 | $this->sliceLength = $sliceLength; 34 | $this->numberingOffset = $numberingOffset; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/UuidCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Ramsey\Uuid\UuidInterface; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | /** 18 | * @author Grégoire Pineau 19 | */ 20 | final class UuidCaster 21 | { 22 | public static function castRamseyUuid(UuidInterface $c, array $a, Stub $stub, bool $isNested): array 23 | { 24 | $a += [ 25 | Caster::PREFIX_VIRTUAL.'uuid' => (string) $c, 26 | ]; 27 | 28 | return $a; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/XmlReaderCaster.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace Symfony\Component\VarDumper\Caster; 12 | 13 | use Symfony\Component\VarDumper\Cloner\Stub; 14 | 15 | /** 16 | * Casts XmlReader class to array representation. 17 | * 18 | * @author Baptiste Clavié 19 | * 20 | * @final 21 | */ 22 | class XmlReaderCaster 23 | { 24 | private const NODE_TYPES = [ 25 | \XMLReader::NONE => 'NONE', 26 | \XMLReader::ELEMENT => 'ELEMENT', 27 | \XMLReader::ATTRIBUTE => 'ATTRIBUTE', 28 | \XMLReader::TEXT => 'TEXT', 29 | \XMLReader::CDATA => 'CDATA', 30 | \XMLReader::ENTITY_REF => 'ENTITY_REF', 31 | \XMLReader::ENTITY => 'ENTITY', 32 | \XMLReader::PI => 'PI (Processing Instruction)', 33 | \XMLReader::COMMENT => 'COMMENT', 34 | \XMLReader::DOC => 'DOC', 35 | \XMLReader::DOC_TYPE => 'DOC_TYPE', 36 | \XMLReader::DOC_FRAGMENT => 'DOC_FRAGMENT', 37 | \XMLReader::NOTATION => 'NOTATION', 38 | \XMLReader::WHITESPACE => 'WHITESPACE', 39 | \XMLReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE', 40 | \XMLReader::END_ELEMENT => 'END_ELEMENT', 41 | \XMLReader::END_ENTITY => 'END_ENTITY', 42 | \XMLReader::XML_DECLARATION => 'XML_DECLARATION', 43 | ]; 44 | 45 | public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested) 46 | { 47 | $props = Caster::PREFIX_VIRTUAL.'parserProperties'; 48 | $info = [ 49 | 'localName' => $reader->localName, 50 | 'prefix' => $reader->prefix, 51 | 'nodeType' => new ConstStub(self::NODE_TYPES[$reader->nodeType], $reader->nodeType), 52 | 'depth' => $reader->depth, 53 | 'isDefault' => $reader->isDefault, 54 | 'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement, 55 | 'xmlLang' => $reader->xmlLang, 56 | 'attributeCount' => $reader->attributeCount, 57 | 'value' => $reader->value, 58 | 'namespaceURI' => $reader->namespaceURI, 59 | 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI, 60 | $props => [ 61 | 'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD), 62 | 'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS), 63 | 'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE), 64 | 'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES), 65 | ], 66 | ]; 67 | 68 | if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, [], $count)) { 69 | $info[$props] = new EnumStub($info[$props]); 70 | $info[$props]->cut = $count; 71 | } 72 | 73 | $info = Caster::filter($info, Caster::EXCLUDE_EMPTY, [], $count); 74 | // +2 because hasValue and hasAttributes are always filtered 75 | $stub->cut += $count + 2; 76 | 77 | return $a + $info; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/XmlResourceCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts XML resources to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class XmlResourceCaster 24 | { 25 | private const XML_ERRORS = [ 26 | \XML_ERROR_NONE => 'XML_ERROR_NONE', 27 | \XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY', 28 | \XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX', 29 | \XML_ERROR_NO_ELEMENTS => 'XML_ERROR_NO_ELEMENTS', 30 | \XML_ERROR_INVALID_TOKEN => 'XML_ERROR_INVALID_TOKEN', 31 | \XML_ERROR_UNCLOSED_TOKEN => 'XML_ERROR_UNCLOSED_TOKEN', 32 | \XML_ERROR_PARTIAL_CHAR => 'XML_ERROR_PARTIAL_CHAR', 33 | \XML_ERROR_TAG_MISMATCH => 'XML_ERROR_TAG_MISMATCH', 34 | \XML_ERROR_DUPLICATE_ATTRIBUTE => 'XML_ERROR_DUPLICATE_ATTRIBUTE', 35 | \XML_ERROR_JUNK_AFTER_DOC_ELEMENT => 'XML_ERROR_JUNK_AFTER_DOC_ELEMENT', 36 | \XML_ERROR_PARAM_ENTITY_REF => 'XML_ERROR_PARAM_ENTITY_REF', 37 | \XML_ERROR_UNDEFINED_ENTITY => 'XML_ERROR_UNDEFINED_ENTITY', 38 | \XML_ERROR_RECURSIVE_ENTITY_REF => 'XML_ERROR_RECURSIVE_ENTITY_REF', 39 | \XML_ERROR_ASYNC_ENTITY => 'XML_ERROR_ASYNC_ENTITY', 40 | \XML_ERROR_BAD_CHAR_REF => 'XML_ERROR_BAD_CHAR_REF', 41 | \XML_ERROR_BINARY_ENTITY_REF => 'XML_ERROR_BINARY_ENTITY_REF', 42 | \XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF => 'XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF', 43 | \XML_ERROR_MISPLACED_XML_PI => 'XML_ERROR_MISPLACED_XML_PI', 44 | \XML_ERROR_UNKNOWN_ENCODING => 'XML_ERROR_UNKNOWN_ENCODING', 45 | \XML_ERROR_INCORRECT_ENCODING => 'XML_ERROR_INCORRECT_ENCODING', 46 | \XML_ERROR_UNCLOSED_CDATA_SECTION => 'XML_ERROR_UNCLOSED_CDATA_SECTION', 47 | \XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING', 48 | ]; 49 | 50 | public static function castXml($h, array $a, Stub $stub, bool $isNested) 51 | { 52 | $a['current_byte_index'] = xml_get_current_byte_index($h); 53 | $a['current_column_number'] = xml_get_current_column_number($h); 54 | $a['current_line_number'] = xml_get_current_line_number($h); 55 | $a['error_code'] = xml_get_error_code($h); 56 | 57 | if (isset(self::XML_ERRORS[$a['error_code']])) { 58 | $a['error_code'] = new ConstStub(self::XML_ERRORS[$a['error_code']], $a['error_code']); 59 | } 60 | 61 | return $a; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/ClonerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * @author Nicolas Grekas 16 | */ 17 | interface ClonerInterface 18 | { 19 | /** 20 | * Clones a PHP variable. 21 | * 22 | * @param mixed $var Any PHP variable 23 | * 24 | * @return Data The cloned variable represented by a Data object 25 | */ 26 | public function cloneVar($var); 27 | } 28 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/Cursor.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * Represents the current state of a dumper while dumping. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class Cursor 20 | { 21 | public const HASH_INDEXED = Stub::ARRAY_INDEXED; 22 | public const HASH_ASSOC = Stub::ARRAY_ASSOC; 23 | public const HASH_OBJECT = Stub::TYPE_OBJECT; 24 | public const HASH_RESOURCE = Stub::TYPE_RESOURCE; 25 | 26 | public $depth = 0; 27 | public $refIndex = 0; 28 | public $softRefTo = 0; 29 | public $softRefCount = 0; 30 | public $softRefHandle = 0; 31 | public $hardRefTo = 0; 32 | public $hardRefCount = 0; 33 | public $hardRefHandle = 0; 34 | public $hashType; 35 | public $hashKey; 36 | public $hashKeyIsBinary; 37 | public $hashIndex = 0; 38 | public $hashLength = 0; 39 | public $hashCut = 0; 40 | public $stop = false; 41 | public $attr = []; 42 | public $skipChildren = false; 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/DumperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * DumperInterface used by Data objects. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | interface DumperInterface 20 | { 21 | /** 22 | * Dumps a scalar value. 23 | * 24 | * @param string $type The PHP type of the value being dumped 25 | * @param string|int|float|bool $value The scalar value being dumped 26 | */ 27 | public function dumpScalar(Cursor $cursor, string $type, $value); 28 | 29 | /** 30 | * Dumps a string. 31 | * 32 | * @param string $str The string being dumped 33 | * @param bool $bin Whether $str is UTF-8 or binary encoded 34 | * @param int $cut The number of characters $str has been cut by 35 | */ 36 | public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut); 37 | 38 | /** 39 | * Dumps while entering an hash. 40 | * 41 | * @param int $type A Cursor::HASH_* const for the type of hash 42 | * @param string|int $class The object class, resource type or array count 43 | * @param bool $hasChild When the dump of the hash has child item 44 | */ 45 | public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild); 46 | 47 | /** 48 | * Dumps while leaving an hash. 49 | * 50 | * @param int $type A Cursor::HASH_* const for the type of hash 51 | * @param string|int $class The object class, resource type or array count 52 | * @param bool $hasChild When the dump of the hash has child item 53 | * @param int $cut The number of items the hash has been cut by 54 | */ 55 | public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut); 56 | } 57 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/Stub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * Represents the main properties of a PHP variable. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class Stub 20 | { 21 | public const TYPE_REF = 1; 22 | public const TYPE_STRING = 2; 23 | public const TYPE_ARRAY = 3; 24 | public const TYPE_OBJECT = 4; 25 | public const TYPE_RESOURCE = 5; 26 | 27 | public const STRING_BINARY = 1; 28 | public const STRING_UTF8 = 2; 29 | 30 | public const ARRAY_ASSOC = 1; 31 | public const ARRAY_INDEXED = 2; 32 | 33 | public $type = self::TYPE_REF; 34 | public $class = ''; 35 | public $value; 36 | public $cut = 0; 37 | public $handle = 0; 38 | public $refCount = 0; 39 | public $position = 0; 40 | public $attr = []; 41 | 42 | private static $defaultProperties = []; 43 | 44 | /** 45 | * @internal 46 | */ 47 | public function __sleep(): array 48 | { 49 | $properties = []; 50 | 51 | if (!isset(self::$defaultProperties[$c = static::class])) { 52 | self::$defaultProperties[$c] = get_class_vars($c); 53 | 54 | foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) { 55 | unset(self::$defaultProperties[$c][$k]); 56 | } 57 | } 58 | 59 | foreach (self::$defaultProperties[$c] as $k => $v) { 60 | if ($this->$k !== $v) { 61 | $properties[] = $k; 62 | } 63 | } 64 | 65 | return $properties; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Command\Descriptor; 13 | 14 | use Symfony\Component\Console\Formatter\OutputFormatterStyle; 15 | use Symfony\Component\Console\Input\ArrayInput; 16 | use Symfony\Component\Console\Output\OutputInterface; 17 | use Symfony\Component\Console\Style\SymfonyStyle; 18 | use Symfony\Component\VarDumper\Cloner\Data; 19 | use Symfony\Component\VarDumper\Dumper\CliDumper; 20 | 21 | /** 22 | * Describe collected data clones for cli output. 23 | * 24 | * @author Maxime Steinhausser 25 | * 26 | * @final 27 | */ 28 | class CliDescriptor implements DumpDescriptorInterface 29 | { 30 | private $dumper; 31 | private $lastIdentifier; 32 | private $supportsHref; 33 | 34 | public function __construct(CliDumper $dumper) 35 | { 36 | $this->dumper = $dumper; 37 | $this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref'); 38 | } 39 | 40 | public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void 41 | { 42 | $io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output); 43 | $this->dumper->setColors($output->isDecorated()); 44 | 45 | $rows = [['date', date('r', (int) $context['timestamp'])]]; 46 | $lastIdentifier = $this->lastIdentifier; 47 | $this->lastIdentifier = $clientId; 48 | 49 | $section = "Received from client #$clientId"; 50 | if (isset($context['request'])) { 51 | $request = $context['request']; 52 | $this->lastIdentifier = $request['identifier']; 53 | $section = sprintf('%s %s', $request['method'], $request['uri']); 54 | if ($controller = $request['controller']) { 55 | $rows[] = ['controller', rtrim($this->dumper->dump($controller, true), "\n")]; 56 | } 57 | } elseif (isset($context['cli'])) { 58 | $this->lastIdentifier = $context['cli']['identifier']; 59 | $section = '$ '.$context['cli']['command_line']; 60 | } 61 | 62 | if ($this->lastIdentifier !== $lastIdentifier) { 63 | $io->section($section); 64 | } 65 | 66 | if (isset($context['source'])) { 67 | $source = $context['source']; 68 | $sourceInfo = sprintf('%s on line %d', $source['name'], $source['line']); 69 | $fileLink = $source['file_link'] ?? null; 70 | if ($this->supportsHref && $fileLink) { 71 | $sourceInfo = sprintf('%s', $fileLink, $sourceInfo); 72 | } 73 | $rows[] = ['source', $sourceInfo]; 74 | $file = $source['file_relative'] ?? $source['file']; 75 | $rows[] = ['file', $file]; 76 | } 77 | 78 | $io->table([], $rows); 79 | 80 | if (!$this->supportsHref && isset($fileLink)) { 81 | $io->writeln(['Open source in your IDE/browser:', $fileLink]); 82 | $io->newLine(); 83 | } 84 | 85 | $this->dumper->dump($data); 86 | $io->newLine(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Command\Descriptor; 13 | 14 | use Symfony\Component\Console\Output\OutputInterface; 15 | use Symfony\Component\VarDumper\Cloner\Data; 16 | 17 | /** 18 | * @author Maxime Steinhausser 19 | */ 20 | interface DumpDescriptorInterface 21 | { 22 | public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Command\Descriptor; 13 | 14 | use Symfony\Component\Console\Output\OutputInterface; 15 | use Symfony\Component\VarDumper\Cloner\Data; 16 | use Symfony\Component\VarDumper\Dumper\HtmlDumper; 17 | 18 | /** 19 | * Describe collected data clones for html output. 20 | * 21 | * @author Maxime Steinhausser 22 | * 23 | * @final 24 | */ 25 | class HtmlDescriptor implements DumpDescriptorInterface 26 | { 27 | private $dumper; 28 | private $initialized = false; 29 | 30 | public function __construct(HtmlDumper $dumper) 31 | { 32 | $this->dumper = $dumper; 33 | } 34 | 35 | public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void 36 | { 37 | if (!$this->initialized) { 38 | $styles = file_get_contents(__DIR__.'/../../Resources/css/htmlDescriptor.css'); 39 | $scripts = file_get_contents(__DIR__.'/../../Resources/js/htmlDescriptor.js'); 40 | $output->writeln(""); 41 | $this->initialized = true; 42 | } 43 | 44 | $title = '-'; 45 | if (isset($context['request'])) { 46 | $request = $context['request']; 47 | $controller = "{$this->dumper->dump($request['controller'], true, ['maxDepth' => 0])}"; 48 | $title = sprintf('%s %s', $request['method'], $uri = $request['uri'], $uri); 49 | $dedupIdentifier = $request['identifier']; 50 | } elseif (isset($context['cli'])) { 51 | $title = '$ '.$context['cli']['command_line']; 52 | $dedupIdentifier = $context['cli']['identifier']; 53 | } else { 54 | $dedupIdentifier = uniqid('', true); 55 | } 56 | 57 | $sourceDescription = ''; 58 | if (isset($context['source'])) { 59 | $source = $context['source']; 60 | $projectDir = $source['project_dir'] ?? null; 61 | $sourceDescription = sprintf('%s on line %d', $source['name'], $source['line']); 62 | if (isset($source['file_link'])) { 63 | $sourceDescription = sprintf('%s', $source['file_link'], $sourceDescription); 64 | } 65 | } 66 | 67 | $isoDate = $this->extractDate($context, 'c'); 68 | $tags = array_filter([ 69 | 'controller' => $controller ?? null, 70 | 'project dir' => $projectDir ?? null, 71 | ]); 72 | 73 | $output->writeln(<< 75 |
76 |
77 |

$title

78 | 81 |
82 | {$this->renderTags($tags)} 83 |
84 |
85 |

86 | $sourceDescription 87 |

88 | {$this->dumper->dump($data, true)} 89 |
90 | 91 | HTML 92 | ); 93 | } 94 | 95 | private function extractDate(array $context, string $format = 'r'): string 96 | { 97 | return date($format, (int) $context['timestamp']); 98 | } 99 | 100 | private function renderTags(array $tags): string 101 | { 102 | if (!$tags) { 103 | return ''; 104 | } 105 | 106 | $renderedTags = ''; 107 | foreach ($tags as $key => $value) { 108 | $renderedTags .= sprintf('
  • %s%s
  • ', $key, $value); 109 | } 110 | 111 | return << 113 |
      114 | $renderedTags 115 |
    116 | 117 | HTML; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Command/ServerDumpCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Command; 13 | 14 | use Symfony\Component\Console\Command\Command; 15 | use Symfony\Component\Console\Exception\InvalidArgumentException; 16 | use Symfony\Component\Console\Input\InputInterface; 17 | use Symfony\Component\Console\Input\InputOption; 18 | use Symfony\Component\Console\Output\OutputInterface; 19 | use Symfony\Component\Console\Style\SymfonyStyle; 20 | use Symfony\Component\VarDumper\Cloner\Data; 21 | use Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor; 22 | use Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface; 23 | use Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor; 24 | use Symfony\Component\VarDumper\Dumper\CliDumper; 25 | use Symfony\Component\VarDumper\Dumper\HtmlDumper; 26 | use Symfony\Component\VarDumper\Server\DumpServer; 27 | 28 | /** 29 | * Starts a dump server to collect and output dumps on a single place with multiple formats support. 30 | * 31 | * @author Maxime Steinhausser 32 | * 33 | * @final 34 | */ 35 | class ServerDumpCommand extends Command 36 | { 37 | protected static $defaultName = 'server:dump'; 38 | 39 | private $server; 40 | 41 | /** @var DumpDescriptorInterface[] */ 42 | private $descriptors; 43 | 44 | public function __construct(DumpServer $server, array $descriptors = []) 45 | { 46 | $this->server = $server; 47 | $this->descriptors = $descriptors + [ 48 | 'cli' => new CliDescriptor(new CliDumper()), 49 | 'html' => new HtmlDescriptor(new HtmlDumper()), 50 | ]; 51 | 52 | parent::__construct(); 53 | } 54 | 55 | protected function configure() 56 | { 57 | $availableFormats = implode(', ', array_keys($this->descriptors)); 58 | 59 | $this 60 | ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli') 61 | ->setDescription('Start a dump server that collects and displays dumps in a single place') 62 | ->setHelp(<<<'EOF' 63 | %command.name% starts a dump server that collects and displays 64 | dumps in a single place for debugging you application: 65 | 66 | php %command.full_name% 67 | 68 | You can consult dumped data in HTML format in your browser by providing the --format=html option 69 | and redirecting the output to a file: 70 | 71 | php %command.full_name% --format="html" > dump.html 72 | 73 | EOF 74 | ) 75 | ; 76 | } 77 | 78 | protected function execute(InputInterface $input, OutputInterface $output): int 79 | { 80 | $io = new SymfonyStyle($input, $output); 81 | $format = $input->getOption('format'); 82 | 83 | if (!$descriptor = $this->descriptors[$format] ?? null) { 84 | throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $format)); 85 | } 86 | 87 | $errorIo = $io->getErrorStyle(); 88 | $errorIo->title('Symfony Var Dumper Server'); 89 | 90 | $this->server->start(); 91 | 92 | $errorIo->success(sprintf('Server listening on %s', $this->server->getHost())); 93 | $errorIo->comment('Quit the server with CONTROL-C.'); 94 | 95 | $this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) { 96 | $descriptor->describe($io, $data, $context, $clientId); 97 | }); 98 | 99 | return 0; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/AbstractDumper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | use Symfony\Component\VarDumper\Cloner\DumperInterface; 16 | 17 | /** 18 | * Abstract mechanism for dumping a Data object. 19 | * 20 | * @author Nicolas Grekas 21 | */ 22 | abstract class AbstractDumper implements DataDumperInterface, DumperInterface 23 | { 24 | public const DUMP_LIGHT_ARRAY = 1; 25 | public const DUMP_STRING_LENGTH = 2; 26 | public const DUMP_COMMA_SEPARATOR = 4; 27 | public const DUMP_TRAILING_COMMA = 8; 28 | 29 | public static $defaultOutput = 'php://output'; 30 | 31 | protected $line = ''; 32 | protected $lineDumper; 33 | protected $outputStream; 34 | protected $decimalPoint; // This is locale dependent 35 | protected $indentPad = ' '; 36 | protected $flags; 37 | 38 | private $charset = ''; 39 | 40 | /** 41 | * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput 42 | * @param string|null $charset The default character encoding to use for non-UTF8 strings 43 | * @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation 44 | */ 45 | public function __construct($output = null, string $charset = null, int $flags = 0) 46 | { 47 | $this->flags = $flags; 48 | $this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8'); 49 | $this->decimalPoint = localeconv(); 50 | $this->decimalPoint = $this->decimalPoint['decimal_point']; 51 | $this->setOutput($output ?: static::$defaultOutput); 52 | if (!$output && \is_string(static::$defaultOutput)) { 53 | static::$defaultOutput = $this->outputStream; 54 | } 55 | } 56 | 57 | /** 58 | * Sets the output destination of the dumps. 59 | * 60 | * @param callable|resource|string $output A line dumper callable, an opened stream or an output path 61 | * 62 | * @return callable|resource|string The previous output destination 63 | */ 64 | public function setOutput($output) 65 | { 66 | $prev = $this->outputStream ?? $this->lineDumper; 67 | 68 | if (\is_callable($output)) { 69 | $this->outputStream = null; 70 | $this->lineDumper = $output; 71 | } else { 72 | if (\is_string($output)) { 73 | $output = fopen($output, 'w'); 74 | } 75 | $this->outputStream = $output; 76 | $this->lineDumper = [$this, 'echoLine']; 77 | } 78 | 79 | return $prev; 80 | } 81 | 82 | /** 83 | * Sets the default character encoding to use for non-UTF8 strings. 84 | * 85 | * @return string The previous charset 86 | */ 87 | public function setCharset(string $charset) 88 | { 89 | $prev = $this->charset; 90 | 91 | $charset = strtoupper($charset); 92 | $charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset; 93 | 94 | $this->charset = $charset; 95 | 96 | return $prev; 97 | } 98 | 99 | /** 100 | * Sets the indentation pad string. 101 | * 102 | * @param string $pad A string that will be prepended to dumped lines, repeated by nesting level 103 | * 104 | * @return string The previous indent pad 105 | */ 106 | public function setIndentPad(string $pad) 107 | { 108 | $prev = $this->indentPad; 109 | $this->indentPad = $pad; 110 | 111 | return $prev; 112 | } 113 | 114 | /** 115 | * Dumps a Data object. 116 | * 117 | * @param callable|resource|string|true|null $output A line dumper callable, an opened stream, an output path or true to return the dump 118 | * 119 | * @return string|null The dump as string when $output is true 120 | */ 121 | public function dump(Data $data, $output = null) 122 | { 123 | $this->decimalPoint = localeconv(); 124 | $this->decimalPoint = $this->decimalPoint['decimal_point']; 125 | 126 | if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(\LC_NUMERIC, 0) : null) { 127 | setlocale(\LC_NUMERIC, 'C'); 128 | } 129 | 130 | if ($returnDump = true === $output) { 131 | $output = fopen('php://memory', 'r+'); 132 | } 133 | if ($output) { 134 | $prevOutput = $this->setOutput($output); 135 | } 136 | try { 137 | $data->dump($this); 138 | $this->dumpLine(-1); 139 | 140 | if ($returnDump) { 141 | $result = stream_get_contents($output, -1, 0); 142 | fclose($output); 143 | 144 | return $result; 145 | } 146 | } finally { 147 | if ($output) { 148 | $this->setOutput($prevOutput); 149 | } 150 | if ($locale) { 151 | setlocale(\LC_NUMERIC, $locale); 152 | } 153 | } 154 | 155 | return null; 156 | } 157 | 158 | /** 159 | * Dumps the current line. 160 | * 161 | * @param int $depth The recursive depth in the dumped structure for the line being dumped, 162 | * or -1 to signal the end-of-dump to the line dumper callable 163 | */ 164 | protected function dumpLine(int $depth) 165 | { 166 | ($this->lineDumper)($this->line, $depth, $this->indentPad); 167 | $this->line = ''; 168 | } 169 | 170 | /** 171 | * Generic line dumper callback. 172 | */ 173 | protected function echoLine(string $line, int $depth, string $indentPad) 174 | { 175 | if (-1 !== $depth) { 176 | fwrite($this->outputStream, str_repeat($indentPad, $depth).$line."\n"); 177 | } 178 | } 179 | 180 | /** 181 | * Converts a non-UTF-8 string to UTF-8. 182 | * 183 | * @return string|null The string converted to UTF-8 184 | */ 185 | protected function utf8Encode(?string $s) 186 | { 187 | if (null === $s || preg_match('//u', $s)) { 188 | return $s; 189 | } 190 | 191 | if (!\function_exists('iconv')) { 192 | throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.'); 193 | } 194 | 195 | if (false !== $c = @iconv($this->charset, 'UTF-8', $s)) { 196 | return $c; 197 | } 198 | if ('CP1252' !== $this->charset && false !== $c = @iconv('CP1252', 'UTF-8', $s)) { 199 | return $c; 200 | } 201 | 202 | return iconv('CP850', 'UTF-8', $s); 203 | } 204 | } 205 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper\ContextProvider; 13 | 14 | /** 15 | * Tries to provide context on CLI. 16 | * 17 | * @author Maxime Steinhausser 18 | */ 19 | final class CliContextProvider implements ContextProviderInterface 20 | { 21 | public function getContext(): ?array 22 | { 23 | if ('cli' !== \PHP_SAPI) { 24 | return null; 25 | } 26 | 27 | return [ 28 | 'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []), 29 | 'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']), 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper\ContextProvider; 13 | 14 | /** 15 | * Interface to provide contextual data about dump data clones sent to a server. 16 | * 17 | * @author Maxime Steinhausser 18 | */ 19 | interface ContextProviderInterface 20 | { 21 | /** 22 | * @return array|null Context data or null if unable to provide any context 23 | */ 24 | public function getContext(): ?array; 25 | } 26 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper\ContextProvider; 13 | 14 | use Symfony\Component\HttpFoundation\RequestStack; 15 | use Symfony\Component\VarDumper\Caster\ReflectionCaster; 16 | use Symfony\Component\VarDumper\Cloner\VarCloner; 17 | 18 | /** 19 | * Tries to provide context from a request. 20 | * 21 | * @author Maxime Steinhausser 22 | */ 23 | final class RequestContextProvider implements ContextProviderInterface 24 | { 25 | private $requestStack; 26 | private $cloner; 27 | 28 | public function __construct(RequestStack $requestStack) 29 | { 30 | $this->requestStack = $requestStack; 31 | $this->cloner = new VarCloner(); 32 | $this->cloner->setMaxItems(0); 33 | $this->cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); 34 | } 35 | 36 | public function getContext(): ?array 37 | { 38 | if (null === $request = $this->requestStack->getCurrentRequest()) { 39 | return null; 40 | } 41 | 42 | $controller = $request->attributes->get('_controller'); 43 | 44 | return [ 45 | 'uri' => $request->getUri(), 46 | 'method' => $request->getMethod(), 47 | 'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller, 48 | 'identifier' => spl_object_hash($request), 49 | ]; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper\ContextProvider; 13 | 14 | use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; 15 | use Symfony\Component\VarDumper\Cloner\VarCloner; 16 | use Symfony\Component\VarDumper\Dumper\HtmlDumper; 17 | use Symfony\Component\VarDumper\VarDumper; 18 | use Twig\Template; 19 | 20 | /** 21 | * Tries to provide context from sources (class name, file, line, code excerpt, ...). 22 | * 23 | * @author Nicolas Grekas 24 | * @author Maxime Steinhausser 25 | */ 26 | final class SourceContextProvider implements ContextProviderInterface 27 | { 28 | private $limit; 29 | private $charset; 30 | private $projectDir; 31 | private $fileLinkFormatter; 32 | 33 | public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9) 34 | { 35 | $this->charset = $charset; 36 | $this->projectDir = $projectDir; 37 | $this->fileLinkFormatter = $fileLinkFormatter; 38 | $this->limit = $limit; 39 | } 40 | 41 | public function getContext(): ?array 42 | { 43 | $trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, $this->limit); 44 | 45 | $file = $trace[1]['file']; 46 | $line = $trace[1]['line']; 47 | $name = false; 48 | $fileExcerpt = false; 49 | 50 | for ($i = 2; $i < $this->limit; ++$i) { 51 | if (isset($trace[$i]['class'], $trace[$i]['function']) 52 | && 'dump' === $trace[$i]['function'] 53 | && VarDumper::class === $trace[$i]['class'] 54 | ) { 55 | $file = $trace[$i]['file'] ?? $file; 56 | $line = $trace[$i]['line'] ?? $line; 57 | 58 | while (++$i < $this->limit) { 59 | if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && !str_starts_with($trace[$i]['function'], 'call_user_func')) { 60 | $file = $trace[$i]['file']; 61 | $line = $trace[$i]['line']; 62 | 63 | break; 64 | } elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof Template) { 65 | $template = $trace[$i]['object']; 66 | $name = $template->getTemplateName(); 67 | $src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false); 68 | $info = $template->getDebugInfo(); 69 | if (isset($info[$trace[$i - 1]['line']])) { 70 | $line = $info[$trace[$i - 1]['line']]; 71 | $file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null; 72 | 73 | if ($src) { 74 | $src = explode("\n", $src); 75 | $fileExcerpt = []; 76 | 77 | for ($i = max($line - 3, 1), $max = min($line + 3, \count($src)); $i <= $max; ++$i) { 78 | $fileExcerpt[] = ''.$this->htmlEncode($src[$i - 1]).''; 79 | } 80 | 81 | $fileExcerpt = '
      '.implode("\n", $fileExcerpt).'
    '; 82 | } 83 | } 84 | break; 85 | } 86 | } 87 | break; 88 | } 89 | } 90 | 91 | if (false === $name) { 92 | $name = str_replace('\\', '/', $file); 93 | $name = substr($name, strrpos($name, '/') + 1); 94 | } 95 | 96 | $context = ['name' => $name, 'file' => $file, 'line' => $line]; 97 | $context['file_excerpt'] = $fileExcerpt; 98 | 99 | if (null !== $this->projectDir) { 100 | $context['project_dir'] = $this->projectDir; 101 | if (str_starts_with($file, $this->projectDir)) { 102 | $context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR); 103 | } 104 | } 105 | 106 | if ($this->fileLinkFormatter && $fileLink = $this->fileLinkFormatter->format($context['file'], $context['line'])) { 107 | $context['file_link'] = $fileLink; 108 | } 109 | 110 | return $context; 111 | } 112 | 113 | private function htmlEncode(string $s): string 114 | { 115 | $html = ''; 116 | 117 | $dumper = new HtmlDumper(function ($line) use (&$html) { $html .= $line; }, $this->charset); 118 | $dumper->setDumpHeader(''); 119 | $dumper->setDumpBoundaries('', ''); 120 | 121 | $cloner = new VarCloner(); 122 | $dumper->dump($cloner->cloneVar($s)); 123 | 124 | return substr(strip_tags($html), 1, -1); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; 16 | 17 | /** 18 | * @author Kévin Thérage 19 | */ 20 | class ContextualizedDumper implements DataDumperInterface 21 | { 22 | private $wrappedDumper; 23 | private $contextProviders; 24 | 25 | /** 26 | * @param ContextProviderInterface[] $contextProviders 27 | */ 28 | public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders) 29 | { 30 | $this->wrappedDumper = $wrappedDumper; 31 | $this->contextProviders = $contextProviders; 32 | } 33 | 34 | public function dump(Data $data) 35 | { 36 | $context = []; 37 | foreach ($this->contextProviders as $contextProvider) { 38 | $context[\get_class($contextProvider)] = $contextProvider->getContext(); 39 | } 40 | 41 | $this->wrappedDumper->dump($data->withContext($context)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/DataDumperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | 16 | /** 17 | * DataDumperInterface for dumping Data objects. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | interface DataDumperInterface 22 | { 23 | public function dump(Data $data); 24 | } 25 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ServerDumper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; 16 | use Symfony\Component\VarDumper\Server\Connection; 17 | 18 | /** 19 | * ServerDumper forwards serialized Data clones to a server. 20 | * 21 | * @author Maxime Steinhausser 22 | */ 23 | class ServerDumper implements DataDumperInterface 24 | { 25 | private $connection; 26 | private $wrappedDumper; 27 | 28 | /** 29 | * @param string $host The server host 30 | * @param DataDumperInterface|null $wrappedDumper A wrapped instance used whenever we failed contacting the server 31 | * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name 32 | */ 33 | public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = []) 34 | { 35 | $this->connection = new Connection($host, $contextProviders); 36 | $this->wrappedDumper = $wrappedDumper; 37 | } 38 | 39 | public function getContextProviders(): array 40 | { 41 | return $this->connection->getContextProviders(); 42 | } 43 | 44 | /** 45 | * {@inheritdoc} 46 | */ 47 | public function dump(Data $data) 48 | { 49 | if (!$this->connection->write($data) && $this->wrappedDumper) { 50 | $this->wrappedDumper->dump($data); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Exception/ThrowingCasterException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Exception; 13 | 14 | /** 15 | * @author Nicolas Grekas 16 | */ 17 | class ThrowingCasterException extends \Exception 18 | { 19 | /** 20 | * @param \Throwable $prev The exception thrown from the caster 21 | */ 22 | public function __construct(\Throwable $prev) 23 | { 24 | parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2021 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/README.md: -------------------------------------------------------------------------------- 1 | VarDumper Component 2 | =================== 3 | 4 | The VarDumper component provides mechanisms for walking through any arbitrary 5 | PHP variable. It provides a better `dump()` function that you can use instead 6 | of `var_dump`. 7 | 8 | Resources 9 | --------- 10 | 11 | * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html) 12 | * [Contributing](https://symfony.com/doc/current/contributing/index.html) 13 | * [Report issues](https://github.com/symfony/symfony/issues) and 14 | [send Pull Requests](https://github.com/symfony/symfony/pulls) 15 | in the [main Symfony repository](https://github.com/symfony/symfony) 16 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/bin/var-dump-server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | 8 | * 9 | * For the full copyright and license information, please view the LICENSE 10 | * file that was distributed with this source code. 11 | */ 12 | 13 | /** 14 | * Starts a dump server to collect and output dumps on a single place with multiple formats support. 15 | * 16 | * @author Maxime Steinhausser 17 | */ 18 | 19 | use Psr\Log\LoggerInterface; 20 | use Symfony\Component\Console\Application; 21 | use Symfony\Component\Console\Input\ArgvInput; 22 | use Symfony\Component\Console\Input\InputOption; 23 | use Symfony\Component\Console\Logger\ConsoleLogger; 24 | use Symfony\Component\Console\Output\ConsoleOutput; 25 | use Symfony\Component\VarDumper\Command\ServerDumpCommand; 26 | use Symfony\Component\VarDumper\Server\DumpServer; 27 | 28 | function includeIfExists(string $file): bool 29 | { 30 | return file_exists($file) && include $file; 31 | } 32 | 33 | if ( 34 | !includeIfExists(__DIR__ . '/../../../../autoload.php') && 35 | !includeIfExists(__DIR__ . '/../../vendor/autoload.php') && 36 | !includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php') 37 | ) { 38 | fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL); 39 | exit(1); 40 | } 41 | 42 | if (!class_exists(Application::class)) { 43 | fwrite(STDERR, 'You need the "symfony/console" component in order to run the VarDumper server.'.PHP_EOL); 44 | exit(1); 45 | } 46 | 47 | $input = new ArgvInput(); 48 | $output = new ConsoleOutput(); 49 | $defaultHost = '127.0.0.1:9912'; 50 | $host = $input->getParameterOption(['--host'], $_SERVER['VAR_DUMPER_SERVER'] ?? $defaultHost, true); 51 | $logger = interface_exists(LoggerInterface::class) ? new ConsoleLogger($output->getErrorOutput()) : null; 52 | 53 | $app = new Application(); 54 | 55 | $app->getDefinition()->addOption( 56 | new InputOption('--host', null, InputOption::VALUE_REQUIRED, 'The address the server should listen to', $defaultHost) 57 | ); 58 | 59 | $app->add($command = new ServerDumpCommand(new DumpServer($host, $logger))) 60 | ->getApplication() 61 | ->setDefaultCommand($command->getName(), true) 62 | ->run($input, $output) 63 | ; 64 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css: -------------------------------------------------------------------------------- 1 | body { 2 | display: flex; 3 | flex-direction: column-reverse; 4 | justify-content: flex-end; 5 | max-width: 1140px; 6 | margin: auto; 7 | padding: 15px; 8 | word-wrap: break-word; 9 | background-color: #F9F9F9; 10 | color: #222; 11 | font-family: Helvetica, Arial, sans-serif; 12 | font-size: 14px; 13 | line-height: 1.4; 14 | } 15 | p { 16 | margin: 0; 17 | } 18 | a { 19 | color: #218BC3; 20 | text-decoration: none; 21 | } 22 | a:hover { 23 | text-decoration: underline; 24 | } 25 | .text-small { 26 | font-size: 12px !important; 27 | } 28 | article { 29 | margin: 5px; 30 | margin-bottom: 10px; 31 | } 32 | article > header > .row { 33 | display: flex; 34 | flex-direction: row; 35 | align-items: baseline; 36 | margin-bottom: 10px; 37 | } 38 | article > header > .row > .col { 39 | flex: 1; 40 | display: flex; 41 | align-items: baseline; 42 | } 43 | article > header > .row > h2 { 44 | font-size: 14px; 45 | color: #222; 46 | font-weight: normal; 47 | font-family: "Lucida Console", monospace, sans-serif; 48 | word-break: break-all; 49 | margin: 20px 5px 0 0; 50 | user-select: all; 51 | } 52 | article > header > .row > h2 > code { 53 | white-space: nowrap; 54 | user-select: none; 55 | color: #cc2255; 56 | background-color: #f7f7f9; 57 | border: 1px solid #e1e1e8; 58 | border-radius: 3px; 59 | margin-right: 5px; 60 | padding: 0 3px; 61 | } 62 | article > header > .row > time.col { 63 | flex: 0; 64 | text-align: right; 65 | white-space: nowrap; 66 | color: #999; 67 | font-style: italic; 68 | } 69 | article > header ul.tags { 70 | list-style: none; 71 | padding: 0; 72 | margin: 0; 73 | font-size: 12px; 74 | } 75 | article > header ul.tags > li { 76 | user-select: all; 77 | margin-bottom: 2px; 78 | } 79 | article > header ul.tags > li > span.badge { 80 | display: inline-block; 81 | padding: .25em .4em; 82 | margin-right: 5px; 83 | border-radius: 4px; 84 | background-color: #6c757d3b; 85 | color: #524d4d; 86 | font-size: 12px; 87 | text-align: center; 88 | font-weight: 700; 89 | line-height: 1; 90 | white-space: nowrap; 91 | vertical-align: baseline; 92 | user-select: none; 93 | } 94 | article > section.body { 95 | border: 1px solid #d8d8d8; 96 | background: #FFF; 97 | padding: 10px; 98 | border-radius: 3px; 99 | } 100 | pre.sf-dump { 101 | border-radius: 3px; 102 | margin-bottom: 0; 103 | } 104 | .hidden { 105 | display: none !important; 106 | } 107 | .dumped-tag > .sf-dump { 108 | display: inline-block; 109 | margin: 0; 110 | padding: 1px 5px; 111 | line-height: 1.4; 112 | vertical-align: top; 113 | background-color: transparent; 114 | user-select: auto; 115 | } 116 | .dumped-tag > pre.sf-dump, 117 | .dumped-tag > .sf-dump-default { 118 | color: #CC7832; 119 | background: none; 120 | } 121 | .dumped-tag > .sf-dump .sf-dump-str { color: #629755; } 122 | .dumped-tag > .sf-dump .sf-dump-private, 123 | .dumped-tag > .sf-dump .sf-dump-protected, 124 | .dumped-tag > .sf-dump .sf-dump-public { color: #262626; } 125 | .dumped-tag > .sf-dump .sf-dump-note { color: #6897BB; } 126 | .dumped-tag > .sf-dump .sf-dump-key { color: #789339; } 127 | .dumped-tag > .sf-dump .sf-dump-ref { color: #6E6E6E; } 128 | .dumped-tag > .sf-dump .sf-dump-ellipsis { color: #CC7832; max-width: 100em; } 129 | .dumped-tag > .sf-dump .sf-dump-ellipsis-path { max-width: 5em; } 130 | .dumped-tag > .sf-dump .sf-dump-ns { user-select: none; } 131 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/functions/dump.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Component\VarDumper\VarDumper; 13 | 14 | if (!function_exists('dump')) { 15 | /** 16 | * @author Nicolas Grekas 17 | */ 18 | function dump($var, ...$moreVars) 19 | { 20 | VarDumper::dump($var); 21 | 22 | foreach ($moreVars as $v) { 23 | VarDumper::dump($v); 24 | } 25 | 26 | if (1 < func_num_args()) { 27 | return func_get_args(); 28 | } 29 | 30 | return $var; 31 | } 32 | } 33 | 34 | if (!function_exists('dd')) { 35 | function dd(...$vars) 36 | { 37 | foreach ($vars as $v) { 38 | VarDumper::dump($v); 39 | } 40 | 41 | exit(1); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | let prev = null; 3 | Array.from(document.getElementsByTagName('article')).reverse().forEach(function (article) { 4 | const dedupId = article.dataset.dedupId; 5 | if (dedupId === prev) { 6 | article.getElementsByTagName('header')[0].classList.add('hidden'); 7 | } 8 | prev = dedupId; 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Server/Connection.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Server; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; 16 | 17 | /** 18 | * Forwards serialized Data clones to a server. 19 | * 20 | * @author Maxime Steinhausser 21 | */ 22 | class Connection 23 | { 24 | private $host; 25 | private $contextProviders; 26 | private $socket; 27 | 28 | /** 29 | * @param string $host The server host 30 | * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name 31 | */ 32 | public function __construct(string $host, array $contextProviders = []) 33 | { 34 | if (!str_contains($host, '://')) { 35 | $host = 'tcp://'.$host; 36 | } 37 | 38 | $this->host = $host; 39 | $this->contextProviders = $contextProviders; 40 | } 41 | 42 | public function getContextProviders(): array 43 | { 44 | return $this->contextProviders; 45 | } 46 | 47 | public function write(Data $data): bool 48 | { 49 | $socketIsFresh = !$this->socket; 50 | if (!$this->socket = $this->socket ?: $this->createSocket()) { 51 | return false; 52 | } 53 | 54 | $context = ['timestamp' => microtime(true)]; 55 | foreach ($this->contextProviders as $name => $provider) { 56 | $context[$name] = $provider->getContext(); 57 | } 58 | $context = array_filter($context); 59 | $encodedPayload = base64_encode(serialize([$data, $context]))."\n"; 60 | 61 | set_error_handler([self::class, 'nullErrorHandler']); 62 | try { 63 | if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { 64 | return true; 65 | } 66 | if (!$socketIsFresh) { 67 | stream_socket_shutdown($this->socket, \STREAM_SHUT_RDWR); 68 | fclose($this->socket); 69 | $this->socket = $this->createSocket(); 70 | } 71 | if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { 72 | return true; 73 | } 74 | } finally { 75 | restore_error_handler(); 76 | } 77 | 78 | return false; 79 | } 80 | 81 | private static function nullErrorHandler(int $t, string $m) 82 | { 83 | // no-op 84 | } 85 | 86 | private function createSocket() 87 | { 88 | set_error_handler([self::class, 'nullErrorHandler']); 89 | try { 90 | return stream_socket_client($this->host, $errno, $errstr, 3, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT); 91 | } finally { 92 | restore_error_handler(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Server/DumpServer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Server; 13 | 14 | use Psr\Log\LoggerInterface; 15 | use Symfony\Component\VarDumper\Cloner\Data; 16 | use Symfony\Component\VarDumper\Cloner\Stub; 17 | 18 | /** 19 | * A server collecting Data clones sent by a ServerDumper. 20 | * 21 | * @author Maxime Steinhausser 22 | * 23 | * @final 24 | */ 25 | class DumpServer 26 | { 27 | private $host; 28 | private $socket; 29 | private $logger; 30 | 31 | public function __construct(string $host, LoggerInterface $logger = null) 32 | { 33 | if (!str_contains($host, '://')) { 34 | $host = 'tcp://'.$host; 35 | } 36 | 37 | $this->host = $host; 38 | $this->logger = $logger; 39 | } 40 | 41 | public function start(): void 42 | { 43 | if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) { 44 | throw new \RuntimeException(sprintf('Server start failed on "%s": ', $this->host).$errstr.' '.$errno); 45 | } 46 | } 47 | 48 | public function listen(callable $callback): void 49 | { 50 | if (null === $this->socket) { 51 | $this->start(); 52 | } 53 | 54 | foreach ($this->getMessages() as $clientId => $message) { 55 | if ($this->logger) { 56 | $this->logger->info('Received a payload from client {clientId}', ['clientId' => $clientId]); 57 | } 58 | 59 | $payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]); 60 | 61 | // Impossible to decode the message, give up. 62 | if (false === $payload) { 63 | if ($this->logger) { 64 | $this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]); 65 | } 66 | 67 | continue; 68 | } 69 | 70 | if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) { 71 | if ($this->logger) { 72 | $this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]); 73 | } 74 | 75 | continue; 76 | } 77 | 78 | [$data, $context] = $payload; 79 | 80 | $callback($data, $context, $clientId); 81 | } 82 | } 83 | 84 | public function getHost(): string 85 | { 86 | return $this->host; 87 | } 88 | 89 | private function getMessages(): iterable 90 | { 91 | $sockets = [(int) $this->socket => $this->socket]; 92 | $write = []; 93 | 94 | while (true) { 95 | $read = $sockets; 96 | stream_select($read, $write, $write, null); 97 | 98 | foreach ($read as $stream) { 99 | if ($this->socket === $stream) { 100 | $stream = stream_socket_accept($this->socket); 101 | $sockets[(int) $stream] = $stream; 102 | } elseif (feof($stream)) { 103 | unset($sockets[(int) $stream]); 104 | fclose($stream); 105 | } else { 106 | yield (int) $stream => fgets($stream); 107 | } 108 | } 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Test/VarDumperTestTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Test; 13 | 14 | use Symfony\Component\VarDumper\Cloner\VarCloner; 15 | use Symfony\Component\VarDumper\Dumper\CliDumper; 16 | 17 | /** 18 | * @author Nicolas Grekas 19 | */ 20 | trait VarDumperTestTrait 21 | { 22 | /** 23 | * @internal 24 | */ 25 | private $varDumperConfig = [ 26 | 'casters' => [], 27 | 'flags' => null, 28 | ]; 29 | 30 | protected function setUpVarDumper(array $casters, int $flags = null): void 31 | { 32 | $this->varDumperConfig['casters'] = $casters; 33 | $this->varDumperConfig['flags'] = $flags; 34 | } 35 | 36 | /** 37 | * @after 38 | */ 39 | protected function tearDownVarDumper(): void 40 | { 41 | $this->varDumperConfig['casters'] = []; 42 | $this->varDumperConfig['flags'] = null; 43 | } 44 | 45 | public function assertDumpEquals($expected, $data, int $filter = 0, string $message = '') 46 | { 47 | $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); 48 | } 49 | 50 | public function assertDumpMatchesFormat($expected, $data, int $filter = 0, string $message = '') 51 | { 52 | $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); 53 | } 54 | 55 | protected function getDump($data, $key = null, int $filter = 0): ?string 56 | { 57 | if (null === $flags = $this->varDumperConfig['flags']) { 58 | $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; 59 | $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; 60 | $flags |= getenv('DUMP_COMMA_SEPARATOR') ? CliDumper::DUMP_COMMA_SEPARATOR : 0; 61 | } 62 | 63 | $cloner = new VarCloner(); 64 | $cloner->addCasters($this->varDumperConfig['casters']); 65 | $cloner->setMaxItems(-1); 66 | $dumper = new CliDumper(null, null, $flags); 67 | $dumper->setColors(false); 68 | $data = $cloner->cloneVar($data, $filter)->withRefHandles(false); 69 | if (null !== $key && null === $data = $data->seek($key)) { 70 | return null; 71 | } 72 | 73 | return rtrim($dumper->dump($data, true)); 74 | } 75 | 76 | private function prepareExpectation($expected, int $filter): string 77 | { 78 | if (!\is_string($expected)) { 79 | $expected = $this->getDump($expected, null, $filter); 80 | } 81 | 82 | return rtrim($expected); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/VarDumper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper; 13 | 14 | use Symfony\Component\HttpFoundation\Request; 15 | use Symfony\Component\HttpFoundation\RequestStack; 16 | use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; 17 | use Symfony\Component\VarDumper\Caster\ReflectionCaster; 18 | use Symfony\Component\VarDumper\Cloner\VarCloner; 19 | use Symfony\Component\VarDumper\Dumper\CliDumper; 20 | use Symfony\Component\VarDumper\Dumper\ContextProvider\CliContextProvider; 21 | use Symfony\Component\VarDumper\Dumper\ContextProvider\RequestContextProvider; 22 | use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; 23 | use Symfony\Component\VarDumper\Dumper\ContextualizedDumper; 24 | use Symfony\Component\VarDumper\Dumper\HtmlDumper; 25 | use Symfony\Component\VarDumper\Dumper\ServerDumper; 26 | 27 | // Load the global dump() function 28 | require_once __DIR__.'/Resources/functions/dump.php'; 29 | 30 | /** 31 | * @author Nicolas Grekas 32 | */ 33 | class VarDumper 34 | { 35 | private static $handler; 36 | 37 | public static function dump($var) 38 | { 39 | if (null === self::$handler) { 40 | self::register(); 41 | } 42 | 43 | return (self::$handler)($var); 44 | } 45 | 46 | public static function setHandler(callable $callable = null) 47 | { 48 | $prevHandler = self::$handler; 49 | 50 | // Prevent replacing the handler with expected format as soon as the env var was set: 51 | if (isset($_SERVER['VAR_DUMPER_FORMAT'])) { 52 | return $prevHandler; 53 | } 54 | 55 | self::$handler = $callable; 56 | 57 | return $prevHandler; 58 | } 59 | 60 | private static function register(): void 61 | { 62 | $cloner = new VarCloner(); 63 | $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); 64 | 65 | $format = $_SERVER['VAR_DUMPER_FORMAT'] ?? null; 66 | switch (true) { 67 | case 'html' === $format: 68 | $dumper = new HtmlDumper(); 69 | break; 70 | case 'cli' === $format: 71 | $dumper = new CliDumper(); 72 | break; 73 | case 'server' === $format: 74 | case $format && 'tcp' === parse_url($format, \PHP_URL_SCHEME): 75 | $host = 'server' === $format ? $_SERVER['VAR_DUMPER_SERVER'] ?? '127.0.0.1:9912' : $format; 76 | $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); 77 | $dumper = new ServerDumper($host, $dumper, self::getDefaultContextProviders()); 78 | break; 79 | default: 80 | $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); 81 | } 82 | 83 | if (!$dumper instanceof ServerDumper) { 84 | $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]); 85 | } 86 | 87 | self::$handler = function ($var) use ($cloner, $dumper) { 88 | $dumper->dump($cloner->cloneVar($var)); 89 | }; 90 | } 91 | 92 | private static function getDefaultContextProviders(): array 93 | { 94 | $contextProviders = []; 95 | 96 | if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && (class_exists(Request::class))) { 97 | $requestStack = new RequestStack(); 98 | $requestStack->push(Request::createFromGlobals()); 99 | $contextProviders['request'] = new RequestContextProvider($requestStack); 100 | } 101 | 102 | $fileLinkFormatter = class_exists(FileLinkFormatter::class) ? new FileLinkFormatter(null, $requestStack ?? null) : null; 103 | 104 | return $contextProviders + [ 105 | 'cli' => new CliContextProvider(), 106 | 'source' => new SourceContextProvider(null, null, $fileLinkFormatter), 107 | ]; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/var-dumper", 3 | "type": "library", 4 | "description": "Provides mechanisms for walking through any arbitrary PHP variable", 5 | "keywords": ["dump", "debug"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.2.5", 20 | "symfony/polyfill-mbstring": "~1.0", 21 | "symfony/polyfill-php80": "^1.16" 22 | }, 23 | "require-dev": { 24 | "ext-iconv": "*", 25 | "symfony/console": "^4.4|^5.0", 26 | "symfony/process": "^4.4|^5.0", 27 | "twig/twig": "^2.13|^3.0.4" 28 | }, 29 | "conflict": { 30 | "phpunit/phpunit": "<5.4.3", 31 | "symfony/console": "<4.4" 32 | }, 33 | "suggest": { 34 | "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", 35 | "ext-intl": "To show region name in time zone dump", 36 | "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" 37 | }, 38 | "autoload": { 39 | "files": [ "Resources/functions/dump.php" ], 40 | "psr-4": { "Symfony\\Component\\VarDumper\\": "" }, 41 | "exclude-from-classmap": [ 42 | "/Tests/" 43 | ] 44 | }, 45 | "bin": [ 46 | "Resources/bin/var-dump-server" 47 | ], 48 | "minimum-stability": "dev" 49 | } 50 | --------------------------------------------------------------------------------