upgraded dependencies
This commit is contained in:
13
vendor/symfony/var-dumper/Caster/Caster.php
vendored
13
vendor/symfony/var-dumper/Caster/Caster.php
vendored
@@ -40,17 +40,14 @@ class Caster
|
||||
/**
|
||||
* Casts objects to arrays and adds the dynamic property prefix.
|
||||
*
|
||||
* @param object $obj The object to cast
|
||||
* @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not
|
||||
*
|
||||
* @return array The array-cast of the object, with prefixed dynamic properties
|
||||
* @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not
|
||||
*/
|
||||
public static function castObject($obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array
|
||||
public static function castObject(object $obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array
|
||||
{
|
||||
if ($hasDebugInfo) {
|
||||
try {
|
||||
$debugInfo = $obj->__debugInfo();
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Throwable $e) {
|
||||
// ignore failing __debugInfo()
|
||||
$hasDebugInfo = false;
|
||||
}
|
||||
@@ -69,7 +66,7 @@ class Caster
|
||||
$i = 0;
|
||||
$prefixedKeys = [];
|
||||
foreach ($a as $k => $v) {
|
||||
if (isset($k[0]) ? "\0" !== $k[0] : \PHP_VERSION_ID >= 70200) {
|
||||
if ("\0" !== ($k[0] ?? '')) {
|
||||
if (!isset($publicProperties[$class])) {
|
||||
foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) {
|
||||
$publicProperties[$class][$prop->name] = true;
|
||||
@@ -119,8 +116,6 @@ class Caster
|
||||
* @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out
|
||||
* @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set
|
||||
* @param int &$count Set to the number of removed properties
|
||||
*
|
||||
* @return array The filtered array
|
||||
*/
|
||||
public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array
|
||||
{
|
||||
|
Reference in New Issue
Block a user