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: v5.4.3
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: v5.4.5
Choose a head ref
  • 4 commits
  • 4 files changed
  • 2 contributors

Commits on Feb 4, 2022

  1. Copy the full SHA
    326244d View commit details
  2. Merge branch '4.4' into 5.4

    * 4.4:
      [Cache] Fix connecting to Redis via a socket file
      [DependencyInjection][FrameworkBundle] Fix using PHP 8.1 enum as parameters
      [PropertyAccessor] Add missing TypeError catch
      [FrameworkBundle] Fix log channel of TagAwareAdapter
      [HttpClient] Fix Content-Length header when possible
      [DependencyInjection] Don't dump polyfilled classes in preload script
    nicolas-grekas committed Feb 4, 2022

    Verified

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

Commits on Feb 21, 2022

  1. Verified

    This commit was signed with the committer’s verified signature.
    targos Michaël Zasso
    Copy the full SHA
    20030f7 View commit details
  2. Merge branch '4.4' into 5.4

    * 4.4:
      [VarDumper] Fix dumping mysqli_driver instances
      Fix missing ReturnTypeWillChange attributes
      [Cache] Add missing log when saving namespace
      [HttpKernel] Reset services between requests performed by KernelBrowser
      [HttpKernel] Remove unused argument in ArgumentMetadataFactory
    nicolas-grekas committed Feb 21, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    targos Michaël Zasso
    Copy the full SHA
    6efddb1 View commit details
Showing with 78 additions and 4 deletions.
  1. +33 −0 Caster/MysqliCaster.php
  2. +2 −0 Cloner/AbstractCloner.php
  3. +39 −0 Tests/Caster/MysqliCasterTest.php
  4. +4 −4 Tests/Caster/RedisCasterTest.php
33 changes: 33 additions & 0 deletions Caster/MysqliCaster.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\VarDumper\Caster;

use Symfony\Component\VarDumper\Cloner\Stub;

/**
* @author Nicolas Grekas <p@tchwork.com>
*
* @internal
*/
final class MysqliCaster
{
public static function castMysqliDriver(\mysqli_driver $c, array $a, Stub $stub, bool $isNested): array
{
foreach ($a as $k => $v) {
if (isset($c->$k)) {
$a[$k] = $c->$k;
}
}

return $a;
}
}
2 changes: 2 additions & 0 deletions Cloner/AbstractCloner.php
Original file line number Diff line number Diff line change
@@ -153,6 +153,8 @@ abstract class AbstractCloner implements ClonerInterface
'Ds\Pair' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPair'],
'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'],

'mysqli_driver' => ['Symfony\Component\VarDumper\Caster\MysqliCaster', 'castMysqliDriver'],

'CurlHandle' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],
':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],

39 changes: 39 additions & 0 deletions Tests/Caster/MysqliCasterTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\VarDumper\Tests\Caster;

use PHPUnit\Framework\TestCase;
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;

/**
* @requires extension mysqli
* @group integration
*/
class MysqliCasterTest extends TestCase
{
use VarDumperTestTrait;

public function testNotConnected()
{
$driver = new \mysqli_driver();
$driver->report_mode = 3;

$xCast = <<<EODUMP
mysqli_driver {%A
+reconnect: false
+report_mode: 3
}
EODUMP;

$this->assertDumpMatchesFormat($xCast, $driver);
}
}
8 changes: 4 additions & 4 deletions Tests/Caster/RedisCasterTest.php
Original file line number Diff line number Diff line change
@@ -38,19 +38,19 @@ public function testNotConnected()

public function testConnected()
{
$redisHost = getenv('REDIS_HOST');
$redisHost = explode(':', getenv('REDIS_HOST')) + [1 => 6379];
$redis = new \Redis();
try {
$redis->connect($redisHost);
$redis->connect(...$redisHost);
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
}

$xCast = <<<EODUMP
Redis {%A
isConnected: true
host: "$redisHost"
port: 6379
host: "{$redisHost[0]}"
port: {$redisHost[1]}
auth: null
mode: ATOMIC
dbNum: 0