-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 5.4: [Security] Allow custom scheme to be used as redirection URIs [Validator] Do not mock metadata factory on debug command tests [HttpKernel][WebProfilerBundle] Fix search feature update Intl component to take into account B-variant when converting Alpha3 to Alpha2. fixing issue with Darwin. [VarDumper] Fix dumping `ArrayObject` with `DumpDataCollector` [VarDumper] Add tests to demonstrate a bug when dumping ArrayObject with full stack fmk [DebugBundle][FrameworkBundle] Fix using the framework without the Console component [FrameworkBundle] Add missing monolog channel tag to the `messenger:failed:retry` command fetch all known ChoiceType values at once [RateLimiter] fix incorrect retryAfter of FixedWindow Fix Finder phpdoc
- Loading branch information
Showing
6 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
Tests/Dumper/functions/dump_data_collector_with_spl_array.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--TEST-- | ||
Test integration with Symfony's DumpDataCollector | ||
--FILE-- | ||
<?php | ||
putenv('NO_COLOR=1'); | ||
|
||
$vendor = __DIR__; | ||
while (!file_exists($vendor.'/vendor')) { | ||
$vendor = dirname($vendor); | ||
} | ||
require $vendor.'/vendor/autoload.php'; | ||
|
||
use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector; | ||
use Symfony\Component\VarDumper\Cloner\VarCloner; | ||
use Symfony\Component\VarDumper\VarDumper; | ||
|
||
VarDumper::setHandler(function ($var, string $label = null) { | ||
$dumper = new DumpDataCollector(); | ||
$cloner = new VarCloner(); | ||
$handler = function ($var, string $label = null) use ($dumper, $cloner) { | ||
$var = $cloner->cloneVar($var); | ||
if (null !== $label) { | ||
$var = $var->withContext(['label' => $label]); | ||
} | ||
|
||
$dumper->dump($var); | ||
}; | ||
VarDumper::setHandler($handler); | ||
$handler($var, $label); | ||
}); | ||
|
||
$arrayObject = new \ArrayObject(); | ||
dump($arrayObject); | ||
$arrayObject['X'] = 'A'; | ||
$arrayObject['Y'] = new \ArrayObject(['type' => 'object']); | ||
$arrayObject['Y']['Z'] = 'B'; | ||
|
||
$arrayIterator = new \ArrayIterator(); | ||
dump($arrayIterator); | ||
$arrayIterator['X'] = 'A'; | ||
$arrayIterator['Y'] = new \ArrayIterator(['type' => 'object']); | ||
$arrayIterator['Y']['Z'] = 'B'; | ||
|
||
$recursiveArrayIterator = new \RecursiveArrayIterator(); | ||
dump($recursiveArrayIterator); | ||
$recursiveArrayIterator['X'] = 'A'; | ||
$recursiveArrayIterator['Y'] = new \RecursiveArrayIterator(['type' => 'object']); | ||
$recursiveArrayIterator['Y']['Z'] = 'B'; | ||
|
||
--EXPECTF-- | ||
%s on line %d: | ||
ArrayObject {#%d | ||
storage: [] | ||
flag::STD_PROP_LIST: false | ||
flag::ARRAY_AS_PROPS: false | ||
iteratorClass: "ArrayIterator" | ||
} | ||
%s on line %d: | ||
ArrayIterator {#%d | ||
storage: [] | ||
flag::STD_PROP_LIST: false | ||
flag::ARRAY_AS_PROPS: false | ||
} | ||
%s on line %d: | ||
RecursiveArrayIterator {#%d | ||
storage: [] | ||
flag::STD_PROP_LIST: false | ||
flag::ARRAY_AS_PROPS: false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters