Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/var-dumper
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.1.0
Choose a base ref
...
head repository: symfony/var-dumper
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.1.3
Choose a head ref
  • 13 commits
  • 16 files changed
  • 3 contributors

Commits on Jun 27, 2022

  1. CS fixes

    nicolas-grekas committed Jun 27, 2022
    Copy the full SHA
    0c30aed View commit details
  2. Merge branch '4.4' into 5.4

    * 4.4:
      CS fixes
      Bump Symfony version to 4.4.44
      Update VERSION for 4.4.43
      Update CONTRIBUTORS for 4.4.43
      Update CHANGELOG for 4.4.43
    nicolas-grekas committed Jun 27, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    targos Michaël Zasso
    Copy the full SHA
    a09f9fc View commit details
  3. Merge branch '5.4' into 6.0

    * 5.4:
      CS fixes
      Bump Symfony version to 5.4.11
      Update VERSION for 5.4.10
      Update CHANGELOG for 5.4.10
      Bump Symfony version to 4.4.44
      Update VERSION for 4.4.43
      Update CONTRIBUTORS for 4.4.43
      Update CHANGELOG for 4.4.43
    nicolas-grekas committed Jun 27, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    targos Michaël Zasso
    Copy the full SHA
    3730500 View commit details
  4. Merge branch '6.0' into 6.1

    * 6.0:
      CS fixes
      Bump Symfony version to 6.0.11
      Update VERSION for 6.0.10
      Update CHANGELOG for 6.0.10
      Bump Symfony version to 5.4.11
      Update VERSION for 5.4.10
      Update CHANGELOG for 5.4.10
      Bump Symfony version to 4.4.44
      Update VERSION for 4.4.43
      Update CONTRIBUTORS for 4.4.43
      Update CHANGELOG for 4.4.43
    nicolas-grekas committed Jun 27, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    targos Michaël Zasso
    Copy the full SHA
    e81fb3e View commit details

Commits on Jul 18, 2022

  1. Copy the full SHA
    72d4d41 View commit details

Commits on Jul 19, 2022

  1. Merge branch '4.4' into 5.4

    * 4.4:
      Fix CS
      quote address names if they contain parentheses
      [FrameworkBundle] Fail gracefully when forms use disabled CSRF
      [Mime] Fix inline parts when added via attachPart()
      Fail gracefully when attempting to autowire composite types
      [VarDumper] Add a test case for nesting intersection and union types
    derrabus committed Jul 19, 2022
    Copy the full SHA
    4d7cb8e View commit details
  2. Merge branch '5.4' into 6.0

    * 5.4:
      Fix CS
      Fix CS
      quote address names if they contain parentheses
      [FrameworkBundle] Fail gracefully when forms use disabled CSRF
      [Mime] Fix inline parts when added via attachPart()
      Fail gracefully when attempting to autowire composite types
      [VarDumper] Add a test case for nesting intersection and union types
      Fix #46592 - Ignore getter with required parameters
      [Serializer] Fix inconsistent behaviour of nullable objects in key/value arrays
    derrabus committed Jul 19, 2022
    Copy the full SHA
    805d447 View commit details
  3. Merge branch '6.0' into 6.1

    * 6.0:
      Fix CS
      Fix CS
      quote address names if they contain parentheses
      [FrameworkBundle] Fail gracefully when forms use disabled CSRF
      [Mime] Fix inline parts when added via attachPart()
      Fail gracefully when attempting to autowire composite types
      [VarDumper] Add a test case for nesting intersection and union types
      Fix #46592 - Ignore getter with required parameters
      [Serializer] Fix inconsistent behaviour of nullable objects in key/value arrays
    derrabus committed Jul 19, 2022
    Copy the full SHA
    4386618 View commit details

Commits on Jul 20, 2022

  1. Fix CS

    fabpot committed Jul 20, 2022
    Copy the full SHA
    f199510 View commit details
  2. Merge branch '4.4' into 5.4

    * 4.4:
      Fix CS
    fabpot committed Jul 20, 2022
    Copy the full SHA
    b58571b View commit details
  3. Fix CS

    fabpot committed Jul 20, 2022
    Copy the full SHA
    b8f306d View commit details
  4. Merge branch '5.4' into 6.0

    * 5.4:
      Fix CS
      Fix CS
    fabpot committed Jul 20, 2022
    Copy the full SHA
    2672bdc View commit details
  5. Merge branch '6.0' into 6.1

    * 6.0:
      Fix CS
      Fix CS
    fabpot committed Jul 20, 2022
    Copy the full SHA
    d5a5e44 View commit details
2 changes: 1 addition & 1 deletion Caster/ArgsStub.php
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ public function __construct(array $args, string $function, ?string $class)

$values = [];
foreach ($args as $k => $v) {
$values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
$values[$k] = !\is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
}
if (null === $params) {
parent::__construct($values, false);
2 changes: 1 addition & 1 deletion Caster/IntlCaster.php
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $
'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL),
'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL),
]
),
),
];

return self::castError($c, $a);
2 changes: 1 addition & 1 deletion Dumper/AbstractDumper.php
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
public function __construct($output = null, string $charset = null, int $flags = 0)
{
$this->flags = $flags;
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
$this->setCharset($charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8');
$this->setOutput($output ?: static::$defaultOutput);
if (!$output && \is_string(static::$defaultOutput)) {
static::$defaultOutput = $this->outputStream;
2 changes: 1 addition & 1 deletion Dumper/CliDumper.php
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ public function __construct($output = null, string $charset = null, int $flags =
]);
}

$this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
$this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
}

/**
4 changes: 2 additions & 2 deletions Dumper/HtmlDumper.php
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ public function __construct($output = null, string $charset = null, int $flags =
{
AbstractDumper::__construct($output, $charset, $flags);
$this->dumpId = 'sf-dump-'.mt_rand();
$this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
$this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
$this->styles = static::$themes['dark'] ?? self::$themes['dark'];
}

@@ -864,7 +864,7 @@ protected function style(string $style, string $value, array $attr = []): string
}

if ('const' === $style && isset($attr['value'])) {
$style .= sprintf(' title="%s"', esc(is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
$style .= sprintf(' title="%s"', esc(\is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
} elseif ('public' === $style) {
$style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
} elseif ('str' === $style && 1 < $attr['length']) {
2 changes: 1 addition & 1 deletion Tests/Caster/ExceptionCasterTest.php
Original file line number Diff line number Diff line change
@@ -151,7 +151,7 @@ public function testShouldReturnTraceForConcreteTwigWithError()

public function testHtmlDump()
{
if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
if (\ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
$this->markTestSkipped('A custom file_link_format is defined.');
}

2 changes: 1 addition & 1 deletion Tests/Caster/RdKafkaCasterTest.php
Original file line number Diff line number Diff line change
@@ -181,7 +181,7 @@ public function testDumpProducerTopic()
$producer->addBrokers($this->broker);

$topic = $producer->newTopic('test');
$topic->produce(RD_KAFKA_PARTITION_UA, 0, '{}');
$topic->produce(\RD_KAFKA_PARTITION_UA, 0, '{}');

$expectedDump = <<<EODUMP
RdKafka\ProducerTopic {
45 changes: 42 additions & 3 deletions Tests/Caster/ReflectionCasterTest.php
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@
use Symfony\Component\VarDumper\Tests\Fixtures\ReflectionIntersectionTypeFixture;
use Symfony\Component\VarDumper\Tests\Fixtures\ReflectionNamedTypeFixture;
use Symfony\Component\VarDumper\Tests\Fixtures\ReflectionUnionTypeFixture;
use Symfony\Component\VarDumper\Tests\Fixtures\ReflectionUnionTypeWithIntersectionFixture;

/**
* @author Nicolas Grekas <p@tchwork.com>
@@ -94,7 +95,7 @@ public function testClosureCaster()
$b: & 123
}
file: "%sReflectionCasterTest.php"
line: "87 to 87"
line: "88 to 88"
}
EOTXT
, $var
@@ -147,7 +148,7 @@ public function testReflectionParameter()
typeHint: "Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass"
}
EOTXT
, $var
, $var
);
}

@@ -318,6 +319,44 @@ public function testReflectionIntersectionType()
);
}

/**
* @requires PHP 8.2
*/
public function testReflectionUnionTypeWithIntersection()
{
$var = (new \ReflectionProperty(ReflectionUnionTypeWithIntersectionFixture::class, 'a'))->getType();
$this->assertDumpMatchesFormat(
<<<'EOTXT'
ReflectionUnionType {
allowsNull: true
types: array:2 [
0 => ReflectionIntersectionType {
allowsNull: false
types: array:2 [
0 => ReflectionNamedType {
name: "Traversable"
allowsNull: false
isBuiltin: false
}
1 => ReflectionNamedType {
name: "Countable"
allowsNull: false
isBuiltin: false
}
]
}
1 => ReflectionNamedType {
name: "null"
allowsNull: true
isBuiltin: true
}
]
}
EOTXT
, $var
);
}

public function testExtendsReflectionType()
{
$var = new ExtendsReflectionTypeFixture();
@@ -333,7 +372,7 @@ public function testExtendsReflectionType()

public function testReturnType()
{
$f = function ():int {};
$f = function (): int {};

$this->assertDumpMatchesFormat(
<<<EOTXT
4 changes: 2 additions & 2 deletions Tests/Caster/XmlReaderCasterTest.php
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ class XmlReaderCasterTest extends TestCase

protected function setUp(): void
{
$this->reader = new \XmlReader();
$this->reader = new \XMLReader();
$this->reader->open(__DIR__.'/../Fixtures/xml_reader.xml');
}

@@ -248,7 +248,7 @@ public function provideNodes()

public function testWithUninitializedXMLReader()
{
$this->reader = new \XmlReader();
$this->reader = new \XMLReader();

$expectedDump = <<<'EODUMP'
XMLReader {
2 changes: 1 addition & 1 deletion Tests/Cloner/VarClonerTest.php
Original file line number Diff line number Diff line change
@@ -330,7 +330,7 @@ public function testLimits()

public function testJsonCast()
{
if (2 == ini_get('xdebug.overload_var_dump')) {
if (2 == \ini_get('xdebug.overload_var_dump')) {
$this->markTestSkipped('xdebug is active');
}

2 changes: 1 addition & 1 deletion Tests/Dumper/HtmlDumperTest.php
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ class HtmlDumperTest extends TestCase
{
public function testGet()
{
if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
if (\ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
$this->markTestSkipped('A custom file_link_format is defined.');
}

2 changes: 1 addition & 1 deletion Tests/Dumper/ServerDumperTest.php
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ public function getContext(): ?array
]
%d
DUMP
, $dumped);
, $dumped);
}

private function getServerProcess(): Process
8 changes: 8 additions & 0 deletions Tests/Fixtures/ReflectionUnionTypeWithIntersectionFixture.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Symfony\Component\VarDumper\Tests\Fixtures;

class ReflectionUnionTypeWithIntersectionFixture
{
public (\Traversable&\Countable)|null $a;
}
2 changes: 1 addition & 1 deletion Tests/Server/ConnectionTest.php
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ public function getContext(): ?array
%d

DUMP
, $dumped);
, $dumped);
}

public function testNoServer()
2 changes: 1 addition & 1 deletion Tests/Test/VarDumperTestTraitTest.php
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ public function testItCanBeConfigured()
}
]
DUMP
, [1, 2, new \DateTime('2019-07-09T0:00:00+00:00')]);
, [1, 2, new \DateTime('2019-07-09T0:00:00+00:00')]);

$this->tearDownVarDumper();

2 changes: 1 addition & 1 deletion VarDumper.php
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ private static function getDefaultContextProviders(): array
{
$contextProviders = [];

if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && (class_exists(Request::class))) {
if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && class_exists(Request::class)) {
$requestStack = new RequestStack();
$requestStack->push(Request::createFromGlobals());
$contextProviders['request'] = new RequestContextProvider($requestStack);